mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 06:31:20 -08:00
docs(audio): [PKG-AUDIO-01] freeze released synchronization contract
This commit is contained in:
1 parent
26b2983daf
commit
8c0a2feed3
12 files changed
+418
-5
No files matched your search
@@ -0,0 +1,14 @@
|
||||
import assert from 'node:assert/strict'
|
||||
// eslint-disable-next-line test/no-import-node-test -- Frozen baseline checks run in Node.
|
||||
import test from 'node:test'
|
||||
import { audioFunctionHash, verifyAudioContract } from './audio-contract.mjs'
|
||||
|
||||
test('Audio Track 1.1.0 archive and historical contract remain immutable', verifyAudioContract)
|
||||
|
||||
test('audio factory comparison ignores formatting but detects changed behavior', async () => {
|
||||
const original = 'export default function artplayerPluginAudioTrack(option) { return option.offset + 1 }'
|
||||
const formatted = 'function artplayerPluginAudioTrack(option) {\n return option.offset + 1;\n }'
|
||||
assert.equal(await audioFunctionHash(original), await audioFunctionHash(formatted))
|
||||
assert.notEqual(await audioFunctionHash(original), await audioFunctionHash(original.replace('+ 1', '+ 2')))
|
||||
await assert.rejects(audioFunctionHash('function unrelated() {}'), /exactly one audio factory/)
|
||||
})
|
||||
Reference in new issue
Block a user