docs(site): [SITE-01] inventory sources and reconcile demo coverage

This commit is contained in:
Harvey Zhao committed 2026-09-14 06:21:25 +08:00
1 parent d62ab13a35
commit d74ecc43cc
21 files changed
+22389 -56

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import assert from 'node:assert/strict'
// eslint-disable-next-line test/no-import-node-test -- Runs with the repository baseline node:test suite.
import test from 'node:test'
import { captureSiteInventory, validateSiteInventory } from './site-inventory.mjs'
test('Site inventory detects omitted HTML, declarations and fingerprint drift', () => {
const snapshot = captureSiteInventory()
validateSiteInventory(snapshot)
for (const mutate of [
value => value.pages = value.pages.filter(page => page.source !== 'docs/mobile.html'),
value => value.editorDeclarations.pop(),
value => value.assets[0].sha256 = 'changed',
value => value.api.pop(),
]) {
const changed = structuredClone(snapshot)
mutate(changed)
assert.throws(() => validateSiteInventory(changed))
}
})