Skip to content

Commit 69a4c4b

Browse files
committed
wait a bunch longer so react doesn't batch
1 parent 2c5b29e commit 69a4c4b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/__tests__/renderHookToSnapshotStream.test.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* eslint-disable no-await-in-loop */
22
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
33
import {EventEmitter} from 'node:events'
4+
import {scheduler} from 'node:timers/promises'
45
import {test, expect} from '@jest/globals'
56
import {renderHookToSnapshotStream} from '@testing-library/react-render-stream'
67
import * as React from 'react'
@@ -33,7 +34,7 @@ test('basic functionality', async () => {
3334
initialProps: 'initial',
3435
})
3536
testEvents.emit('rerenderWithValue', 'value')
36-
await Promise.resolve()
37+
await scheduler.wait(10)
3738
testEvents.emit('rerenderWithValue', 'value2')
3839
{
3940
const snapshot = await takeSnapshot()

0 commit comments

Comments
 (0)