File tree 1 file changed +10
-10
lines changed 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -798,16 +798,16 @@ describe('useSWR - revalidate', () => {
798
798
await waitForDomChange ( { container } )
799
799
expect ( container . firstChild . textContent ) . toMatchInlineSnapshot ( `"0"` )
800
800
801
- await act ( async ( ) => {
802
- // trigger the slower revalidation
803
- faster = false
804
- fireEvent . click ( container . firstElementChild )
805
- await new Promise ( res => setTimeout ( res , 10 ) )
806
- // trigger the faster revalidation
807
- faster = true
808
- fireEvent . click ( container . firstElementChild )
809
- return new Promise ( res => setTimeout ( res , 210 ) )
810
- } )
801
+ // trigger the slower revalidation
802
+ faster = false
803
+ fireEvent . click ( container . firstElementChild )
804
+
805
+ await act ( async ( ) => new Promise ( res => setTimeout ( res , 10 ) ) )
806
+ // trigger the faster revalidation
807
+ faster = true
808
+ fireEvent . click ( container . firstElementChild )
809
+
810
+ await act ( async ( ) => new Promise ( res => setTimeout ( res , 210 ) ) )
811
811
expect ( container . firstChild . textContent ) . toMatchInlineSnapshot ( `"1"` )
812
812
} )
813
813
You can’t perform that action at this time.
0 commit comments