mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 12:41:20 -08:00
test: [ENG-08] add verified TS coverage and paired performance reports
This commit is contained in:
1 parent
8ed0a5228c
commit
4a9a26d4fc
38 files changed
+24335
-61
No files matched your search
@@ -103,7 +103,9 @@ test('timers finish or cancel independently and reject work after disposal', (co
|
||||
timeout(scope, () => calls.push('disposed'), 20)
|
||||
context.mock.timers.tick(5)
|
||||
scope.dispose()
|
||||
timeout(scope, () => calls.push('late'), 0)
|
||||
const release = timeout(scope, () => calls.push('late'), 0)
|
||||
release()
|
||||
release()
|
||||
context.mock.timers.tick(100)
|
||||
assert.deepEqual(calls, ['finished'])
|
||||
})
|
||||
@@ -131,7 +133,9 @@ test('queued RAF is guarded after cancellation, timestamp is forwarded and compl
|
||||
animationFrame(scope, time => calls.push(time))
|
||||
scope.dispose()
|
||||
callbacks[2](24)
|
||||
animationFrame(scope, () => calls.push('late'))
|
||||
const release = animationFrame(scope, () => calls.push('late'))
|
||||
release()
|
||||
release()
|
||||
assert.deepEqual(calls, [12])
|
||||
assert.deepEqual(cancelled, [1, 2, 3])
|
||||
assert.equal(callbacks.length, 3)
|
||||
@@ -160,7 +164,9 @@ test('DOM once reentry, receiver, object listener, external abort and captured o
|
||||
controller.abort()
|
||||
target.dispatchEvent(new Event('object'))
|
||||
scope.dispose()
|
||||
listen(scope, target, 'object', listener)
|
||||
const release = listen(scope, target, 'object', listener)
|
||||
release()
|
||||
release()
|
||||
target.dispatchEvent(new Event('object'))
|
||||
assert.equal(calls, 2)
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user