mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-19 19:51:20 -08:00
test: ENG-03 share behavior fixtures across source and releases
This commit is contained in:
1 parent
b53461da1c
commit
458bc3215d
15 files changed
+260
-74
No files matched your search
@@ -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))
|
||||
}
|
||||
Reference in new issue
Block a user