test: ENG-03 share behavior fixtures across source and releases

This commit is contained in:
Harvey Zhao committed 2026-09-10 21:55:27 +08:00
1 parent b53461da1c
commit 458bc3215d
15 files changed
+260 -74

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
import process from 'node:process'
// eslint-disable-next-line test/no-import-node-test -- Run the same public contract against each actual implementation.
import { test } from 'node:test'
import { emitterContracts } from './contracts/emitter.js'
import { loadCoreArtifact, loadPackage, loadPublishedCore } from './helpers/load.js'
const targets = [await loadPublishedCore(), { name: 'workspace', Artplayer: (await loadPackage('artplayer')).default }]
if (process.env.ARTPLAYER_TEST_CORE)
targets.push(await loadCoreArtifact(process.env.ARTPLAYER_TEST_CORE))
for (const { name, Artplayer } of targets) {
for (const [id, verify] of Object.entries(emitterContracts))
test(`${id}: ${name}`, () => verify(Artplayer.Emitter))
}