Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default async function () {

const res = await fetch(`http://localhost:${defaultServerPort}/`);
const text = await res.text();
const homeMatch = /<link rel="modulepreload" href="(home-[a-zA-Z0-9]{8}\.js)">/;
const homeMatch = /<link rel="modulepreload" href="(home-[a-zA-Z0-9_]{8}\.js)">/;
Comment thread
alan-agius4 marked this conversation as resolved.
assert.match(text, homeMatch, `Response for '/': ${homeMatch} was not matched in content.`);

const link = text.match(homeMatch)?.[1];
Expand All @@ -148,36 +148,36 @@ const RESPONSE_EXPECTS: Record<
}
> = {
'/': {
matches: [/<link rel="modulepreload" href="(home-[a-zA-Z0-9]{8}\.js)">/],
matches: [/<link rel="modulepreload" href="(home-[a-zA-Z0-9_]{8}\.js)">/],
notMatches: [/ssg\-component/, /ssr/, /csr/, /cross-dep-/],
},
'/ssg': {
matches: [
/<link rel="modulepreload" href="(ssg\.routes-[a-zA-Z0-9]{8}\.js)">/,
/<link rel="modulepreload" href="(ssg-component-[a-zA-Z0-9]{8}\.js)">/,
/<link rel="modulepreload" href="(ssg\.routes-[a-zA-Z0-9_]{8}\.js)">/,
/<link rel="modulepreload" href="(ssg-component-[a-zA-Z0-9_]{8}\.js)">/,
],
notMatches: [/home/, /ssr/, /csr/, /ssg-one/, /ssg-two/, /cross-dep-/],
},
'/ssg/one': {
matches: [
/<link rel="modulepreload" href="(ssg\.routes-[a-zA-Z0-9]{8}\.js)">/,
/<link rel="modulepreload" href="(ssg-one-[a-zA-Z0-9]{8}\.js)">/,
/<link rel="modulepreload" href="(ssg\.routes-[a-zA-Z0-9_]{8}\.js)">/,
/<link rel="modulepreload" href="(ssg-one-[a-zA-Z0-9_]{8}\.js)">/,
],
notMatches: [/home/, /ssr/, /csr/, /ssg-two/, /ssg\-component/, /cross-dep-/],
},
'/ssg/two': {
matches: [
/<link rel="modulepreload" href="(ssg\.routes-[a-zA-Z0-9]{8}\.js)">/,
/<link rel="modulepreload" href="(ssg-two-[a-zA-Z0-9]{8}\.js)">/,
/<link rel="modulepreload" href="(ssg\.routes-[a-zA-Z0-9_]{8}\.js)">/,
/<link rel="modulepreload" href="(ssg-two-[a-zA-Z0-9_]{8}\.js)">/,
],
notMatches: [/home/, /ssr/, /csr/, /ssg-one/, /ssg\-component/, /cross-dep-/],
},
'/ssr': {
matches: [/<link rel="modulepreload" href="(ssr-[a-zA-Z0-9]{8}\.js)">/],
matches: [/<link rel="modulepreload" href="(ssr-[a-zA-Z0-9_]{8}\.js)">/],
notMatches: [/home/, /ssg\-component/, /csr/],
},
'/csr': {
matches: [/<link rel="modulepreload" href="(csr-[a-zA-Z0-9]{8}\.js)">/],
matches: [/<link rel="modulepreload" href="(csr-[a-zA-Z0-9_]{8}\.js)">/],
Comment thread
alan-agius4 marked this conversation as resolved.
notMatches: [/home/, /ssg\-component/, /ssr/, /cross-dep-/],
},
};
Expand Down
Loading