test(ci): [CI-01] checkpoint installed audio and subtitle coverage

This commit is contained in:
Harvey Zhao committed 2026-09-15 02:11:36 +08:00
1 parent 34e4136b43
commit 2d45135873
28 files changed
+5724 -37

No files matched your search

+17 -1
View File
@@ -11,13 +11,15 @@ import { ambilightCandidate } from './helpers/ambilight.js'
import { browserCandidate } from './helpers/browser-candidate.js'
import { canvasCandidate } from './helpers/canvas.js'
import { dpipCandidate } from './helpers/dpip.js'
import { multipleSubtitlesCandidate } from './helpers/multiple-subtitles.js'
import { vttThumbnailCandidate } from './helpers/vtt-thumbnail.js'
test('Additional browser packages cannot be mistaken for full release consumer acceptance', async () => {
await assert.rejects(checkPackages({ release: true, include: ['artplayer-plugin-ambilight'] }), /not full release acceptance/)
})
test('Explicit installed plugin maps never fall back to source or frozen workspace', async () => {
const keys = ['ARTPLAYER_BROWSER_ARTIFACTS', 'ARTPLAYER_AMBILIGHT_BASELINE', 'ARTPLAYER_CANVAS_BASELINE', 'ARTPLAYER_DPIP_BASELINE', 'ARTPLAYER_DPIP_ARTIFACT']
const keys = ['ARTPLAYER_BROWSER_ARTIFACTS', 'ARTPLAYER_AMBILIGHT_BASELINE', 'ARTPLAYER_CANVAS_BASELINE', 'ARTPLAYER_DPIP_BASELINE', 'ARTPLAYER_DPIP_ARTIFACT', 'ARTPLAYER_VTT_THUMBNAIL_BASELINE', 'ARTPLAYER_VTT_THUMBNAIL_ARTIFACT', 'ARTPLAYER_MULTIPLE_SUBTITLES_ARTIFACT']
const previous = Object.fromEntries(keys.map(key => [key, process.env[key]]))
try {
process.env.ARTPLAYER_BROWSER_ARTIFACTS = path.resolve('refactor/.cache/absent-installed-plugin-map.json')
@@ -26,11 +28,25 @@ test('Explicit installed plugin maps never fall back to source or frozen workspa
delete process.env.ARTPLAYER_CANVAS_BASELINE
delete process.env.ARTPLAYER_DPIP_BASELINE
delete process.env.ARTPLAYER_DPIP_ARTIFACT
delete process.env.ARTPLAYER_VTT_THUMBNAIL_BASELINE
delete process.env.ARTPLAYER_VTT_THUMBNAIL_ARTIFACT
delete process.env.ARTPLAYER_MULTIPLE_SUBTITLES_ARTIFACT
await assert.rejects(ambilightCandidate(), { code: 'ENOENT' })
await assert.rejects(canvasCandidate(), { code: 'ENOENT' })
await assert.rejects(dpipCandidate(), { code: 'ENOENT' })
await assert.rejects(browserCandidate('artplayer-plugin-ads'), { code: 'ENOENT' })
await assert.rejects(browserCandidate('artplayer-plugin-ads', 'override.js'), /cannot override artplayer-plugin-ads artifact/)
await assert.rejects(browserCandidate('artplayer-plugin-audio-track'), { code: 'ENOENT' })
await assert.rejects(browserCandidate('artplayer-plugin-audio-track', 'override.js'), /cannot override artplayer-plugin-audio-track artifact/)
await assert.rejects(vttThumbnailCandidate(), { code: 'ENOENT' })
await assert.rejects(multipleSubtitlesCandidate(), { code: 'ENOENT' })
process.env.ARTPLAYER_VTT_THUMBNAIL_BASELINE = '1'
await assert.rejects(vttThumbnailCandidate(), /cannot use the frozen workspace/)
delete process.env.ARTPLAYER_VTT_THUMBNAIL_BASELINE
process.env.ARTPLAYER_VTT_THUMBNAIL_ARTIFACT = 'override.js'
process.env.ARTPLAYER_MULTIPLE_SUBTITLES_ARTIFACT = 'override.js'
await assert.rejects(vttThumbnailCandidate(), /cannot override artplayer-plugin-vtt-thumbnail artifact/)
await assert.rejects(multipleSubtitlesCandidate(), /cannot override artplayer-plugin-multiple-subtitles artifact/)
process.env.ARTPLAYER_AMBILIGHT_BASELINE = '1'
process.env.ARTPLAYER_CANVAS_BASELINE = '1'
process.env.ARTPLAYER_DPIP_BASELINE = '1'