File tree Expand file tree Collapse file tree 1 file changed +4
-18
lines changed Expand file tree Collapse file tree 1 file changed +4
-18
lines changed Original file line number Diff line number Diff line change @@ -80,31 +80,17 @@ test('recursive timers do not cause issues', async () => {
8080 recurse = false
8181} )
8282
83- // TODO: Should fail i.e. work the same as with "modern fake timers" once https://github.com/facebook/jest/pull/11567 is released.
84- test ( 'legacy fake timers do not waitFor requestAnimationFrame' , async ( ) => {
83+ test ( 'legacy fake timers do waitFor requestAnimationFrame' , async ( ) => {
8584 jest . useFakeTimers ( 'legacy' )
8685
8786 let exited = false
8887 requestAnimationFrame ( ( ) => {
8988 exited = true
9089 } )
9190
92- await expect ( async ( ) => {
93- await waitFor ( ( ) => {
94- expect ( exited ) . toBe ( true )
95- } )
96- } ) . rejects . toThrowErrorMatchingInlineSnapshot ( `
97- "expect(received).toBe(expected) // Object.is equality
98-
99- Expected: true
100- Received: false
101-
102- Ignored nodes: comments, <script />, <style />
103- <html>
104- <head />
105- <body />
106- </html>"
107- ` )
91+ await waitFor ( ( ) => {
92+ expect ( exited ) . toBe ( true )
93+ } )
10894} )
10995
11096test ( 'modern fake timers do waitFor requestAnimationFrame' , async ( ) => {
You can’t perform that action at this time.
0 commit comments