Skip to content

Commit 98b130e

Browse files
committed
✅ add tests for Node.js support
1 parent 1f715e3 commit 98b130e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ describe('main-thread-scheduling', () => {
3535
expect(isTimeToYieldMocked('background')).toBe(false)
3636
})
3737

38+
test(`check Node.js support`, async () => {
39+
const originalRequestAnimationFrame = window.requestAnimationFrame
40+
41+
;(window as any).requestAnimationFrame = undefined
42+
43+
await yieldControl('user-visible')
44+
await yieldOrContinue('user-visible')
45+
46+
window.requestAnimationFrame = originalRequestAnimationFrame
47+
})
48+
3849
describe('with requestIdleCallback() mock', () => {
3950
beforeEach(() => {
4051
;(window as any).requestIdleCallback = (callback: IdleRequestCallback) => {

0 commit comments

Comments
 (0)