mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-20 12:11:20 -08:00
ci: [CI-01] verify identical tarballs on three Node runtimes
This commit is contained in:
1 parent
585e11c53c
commit
38355ae4cf
21 files changed
+839
-27
No files matched your search
@@ -9,6 +9,8 @@ import ts from 'typescript'
|
||||
import compat from 'typescript-compat'
|
||||
import runtimeCompat from 'typescript-runtime-compat'
|
||||
|
||||
export { runtimeConsumer } from './package-runtime.mjs'
|
||||
|
||||
export const workspace = fileURLToPath(new URL('../', import.meta.url))
|
||||
export const names = ['artplayer', 'artplayer-plugin-chapter']
|
||||
export const readJson = file => JSON.parse(fs.readFileSync(file, 'utf8'))
|
||||
@@ -27,13 +29,6 @@ export function removeConsumer(dir) {
|
||||
fs.rmSync(dir, { recursive: true, force: true })
|
||||
}
|
||||
|
||||
export function runtimeConsumer(dir, { baseline = false } = {}) {
|
||||
fs.copyFileSync(path.join(workspace, 'test/package/runtime.cjs'), path.join(dir, 'runtime.cjs'))
|
||||
fs.copyFileSync(path.join(workspace, 'test/contracts/emitter.js'), path.join(dir, 'emitter.mjs'))
|
||||
writeJson(path.join(dir, 'expected.json'), { version: readJson(path.join(dir, 'node_modules/artplayer/package.json')).version, baseline })
|
||||
return JSON.parse(run(['runtime.cjs'], dir))
|
||||
}
|
||||
|
||||
export function typeConsumers(dir, { precise = false } = {}) {
|
||||
const results = []
|
||||
const matrix = precise
|
||||
|
||||
Reference in new issue
Block a user