mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 13:51:20 -08:00
fix(thumbnail): [PKG-TOOL-THUMB-04] supply public types and installed module entries
This commit is contained in:
1 parent
15485b6420
commit
3bff236145
33 files changed
+2466
-164
No files matched your search
@@ -129,3 +129,24 @@ test('Thumbnail typed facade retains synchronous validation, option mutation and
|
||||
assert.equal(tool.errorHandle(true, 'unused'), undefined)
|
||||
tool.destroy()
|
||||
})
|
||||
|
||||
test('Thumbnail error event preserves arbitrary thrown message values and Promise rejection identity', async () => {
|
||||
for (const failure of [{ message: 7 }, { message: { detail: 'failure' } }, 3, null]) {
|
||||
const { tool } = create(candidate)
|
||||
tool.setup({ number: 10 })
|
||||
tool.file = { name: 'sample.mp4' }
|
||||
tool.video.duration = 100
|
||||
const errors = []
|
||||
tool.on('error', value => errors.push(value))
|
||||
tool.on('update', () => {
|
||||
throw failure
|
||||
})
|
||||
const pending = tool.start()
|
||||
await Promise.resolve()
|
||||
tool.video.oncanplay()
|
||||
await assert.rejects(pending, error => error === failure)
|
||||
assert.deepEqual(errors, [failure?.message])
|
||||
assert.equal(tool.processing, false)
|
||||
tool.destroy()
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user