From b3a6593dd1180e1360fe14cae1c7a8ae9d2af831 Mon Sep 17 00:00:00 2001 From: Simple Analytics Codex Date: Fri, 16 Oct 2026 01:05:30 +0200 Subject: [PATCH] test: require current script version in SRI header checks 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 --- test/deploy.test.mts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/deploy.test.mts b/test/deploy.test.mts index 5bf7727..317db1c 100644 --- a/test/deploy.test.mts +++ b/test/deploy.test.mts @@ -21,6 +21,13 @@ describe("deployment headers", () => { await readdir(new URL("../dist", import.meta.url)) ); assert.ok(version !== undefined, "dist has no versioned SRI directory"); + assert.match( + firstLine( + await readFile(new URL("../dist/latest/latest.js", import.meta.url)) + ), + new RegExp(`; v${version}\\) \\*/$`), + "SRI directory version must match dist/latest/latest.js" + ); const files = createManifest( { destinations: ["cdn", "custom"],