0
Fork 0
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:
Tony Sullivan 2022-04-20 14:33:59 +02:00
parent 2766f326e8
commit bfb01149b3

View file

@ -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;