mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-19 19:51:20 -08:00
test(BASE-04): freeze published DOM input and demo baselines
This commit is contained in:
1 parent
9489392905
commit
2b7054d8a5
16 files changed
+3193
-17
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import test from 'node:test'
|
||||
import { validateDemoInventory } from './demos.mjs'
|
||||
import { refactorDir } from './releases.mjs'
|
||||
|
||||
test('Demo inventory rejects missing files, routes and ecosystem packages', () => {
|
||||
const inventory = JSON.parse(fs.readFileSync(path.join(refactorDir, 'baselines/demo-inventory.json'), 'utf8'))
|
||||
validateDemoInventory(inventory)
|
||||
for (const mutate of [
|
||||
value => value.examples.pop(),
|
||||
value => value.pages.pop(),
|
||||
value => value.examples.find(item => item.menuLinks.length).menuLinks.pop(),
|
||||
value => value.packages.pop(),
|
||||
]) {
|
||||
const changed = structuredClone(inventory)
|
||||
mutate(changed)
|
||||
assert.throws(() => validateDemoInventory(changed))
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user