test: honor baseline fingerprint contracts

User-Visible: no
Issue: #108
This commit is contained in:
Matysh
2026-08-13 01:05:19 +03:00
parent e2b0fbfc06
commit ab609ab165
2 changed files with 33 additions and 1 deletions
+16
View File
@@ -39,3 +39,19 @@ test('bundle freshness rejects a missing or stale fingerprint', async () => {
rmSync(root, { recursive: true, force: true });
}
});
test('bundle freshness uses the target tree fingerprint contract', async () => {
const root = fixtureRoot();
try {
mkdirSync(resolve(root, 'scripts'), { recursive: true });
writeFileSync(
resolve(root, 'scripts/source-fingerprint.mjs'),
"export const sourceFingerprint = () => 'legacy-tree-fingerprint';\n",
'utf8',
);
const page = { evaluate: async () => 'legacy-tree-fingerprint' };
assert.equal(await assertFreshDemoBundle(page, root), 'legacy-tree-fingerprint');
} finally {
rmSync(root, { recursive: true, force: true });
}
});