mirror of
https://github.com/withastro/astro.git
synced 2025-03-17 23:11:29 -05:00
test: updating build test to expect the base path in links/scripts
This commit is contained in:
parent
2766f326e8
commit
bfb01149b3
1 changed files with 4 additions and 8 deletions
|
@ -7,8 +7,12 @@ function addLeadingSlash(path) {
|
|||
}
|
||||
|
||||
function removeBasePath(path) {
|
||||
<<<<<<< HEAD
|
||||
// `/subpath` is defined in the test fixture's Astro config
|
||||
return path.replace('/subpath', '');
|
||||
=======
|
||||
return path.replace('/subpath', '')
|
||||
>>>>>>> f72a3e59 (test: updating build test to expect the base path in links/scripts)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -95,14 +99,6 @@ describe('Static build', () => {
|
|||
const links = $('link[rel=stylesheet]');
|
||||
for (const link of links) {
|
||||
const href = $(link).attr('href');
|
||||
|
||||
/**
|
||||
* The link should be built with the config's `base` included
|
||||
* as a subpath.
|
||||
*
|
||||
* The test needs to verify that the file will be found once the `/dist`
|
||||
* output is deployed to a subpath in production by ignoring the subpath here.
|
||||
*/
|
||||
const data = await fixture.readFile(removeBasePath(addLeadingSlash(href)));
|
||||
if (expected.test(data)) {
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue