Skip to content

Commit fa3cbff

Browse files
simple-analytics-ai[bot]Simple Analytics Codex
andauthored
test: require current script version in SRI header checks (#123)
User requested verifying unresolved CodeRabbit feedback with separate minimal PRs. Require the discovered SRI version to match latest.js so an obsolete version cannot make deployment validation pass. Refs #107 Co-authored-by: Simple Analytics Codex <codex@simpleanalytics.invalid>
1 parent 5ce3453 commit fa3cbff

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎test/deploy.test.mts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ describe("deployment headers", () => {
2121
await readdir(new URL("../dist", import.meta.url))
2222
);
2323
assert.ok(version !== undefined, "dist has no versioned SRI directory");
24+
assert.match(
25+
firstLine(
26+
await readFile(new URL("../dist/latest/latest.js", import.meta.url))
27+
),
28+
new RegExp(`; v${version}\\) \\*/$`),
29+
"SRI directory version must match dist/latest/latest.js"
30+
);
2431
const files = createManifest(
2532
{
2633
destinations: ["cdn", "custom"],

0 commit comments

Comments
 (0)