Assert static asset max-age cache policy in smoke
Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
1 parent
0a1a0c0a27
commit
dbff0f96d3
1 file changed
+7
@@ -195,6 +195,13 @@ async function main() {
|
||||
)}.`,
|
||||
);
|
||||
}
|
||||
if (!assetCacheControl.includes("max-age=31536000")) {
|
||||
throw new Error(
|
||||
`Smoke test failed: expected max-age=31536000 on built asset, got ${String(
|
||||
assetResponse.headers.get("cache-control"),
|
||||
)}.`,
|
||||
);
|
||||
}
|
||||
const missingAssetUrl = new URL("/assets/missing-bundle.js", parsedAppUrl);
|
||||
const missingAsset = await fetch(missingAssetUrl);
|
||||
if (missingAsset.status !== 404) {
|
||||
|
||||
Reference in new issue
Block a user