mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-15 09:06:16 -08:00
docs(site): [SITE-01] inventory sources and reconcile demo coverage
This commit is contained in:
1 parent
d62ab13a35
commit
d74ecc43cc
21 files changed
+22389
-56
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
// eslint-disable-next-line test/no-import-node-test -- Runs with the repository baseline node:test suite.
|
||||
import test from 'node:test'
|
||||
import { validateDemoInventory } from './demos.mjs'
|
||||
import { refactorDir } from './releases.mjs'
|
||||
@@ -19,3 +20,20 @@ test('Demo inventory rejects missing files, routes and ecosystem packages', () =
|
||||
assert.throws(() => validateDemoInventory(changed))
|
||||
}
|
||||
})
|
||||
|
||||
test('Demo additions require complete paths, specific routes and task ownership', () => {
|
||||
const inventory = JSON.parse(fs.readFileSync(path.join(refactorDir, 'baselines/demo-inventory.json'), 'utf8'))
|
||||
const additions = JSON.parse(fs.readFileSync(path.join(refactorDir, 'baselines/demo-additions.json'), 'utf8'))
|
||||
for (const mutate of [
|
||||
value => value.examples.pop(),
|
||||
value => value.examples.push(value.examples[0]),
|
||||
value => value.examples[0].route = '/?example=index',
|
||||
value => value.examples[0].owner = 'UNKNOWN-01',
|
||||
value => value.examples[0].source = 'docs/assets/example/../example/asr.local.js',
|
||||
value => value.examples[0].introducedBy = '',
|
||||
]) {
|
||||
const changed = structuredClone(additions)
|
||||
mutate(changed)
|
||||
assert.throws(() => validateDemoInventory(inventory, changed))
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user