You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The previous version of async act detection left an open hanging act scope, which broke tests and expectations. This PR delays the detection until it's been called at least once.
"It looks like you're using a version of react-dom that supports the \\"act\\" function, but not an awaitable version of \\"act\\" which you will need. Please upgrade to at least [email protected] to remove this warning.",
30
-
],
31
-
]
32
-
`)
39
+
Array [
40
+
Array [
41
+
Array [
42
+
"sigil",
43
+
],
44
+
],
45
+
Array [
46
+
"It looks like you're using a version of react-dom that supports the \\"act\\" function, but not an awaitable version of \\"act\\" which you will need. Please upgrade to at least [email protected] to remove this warning.",
47
+
],
48
+
Array [
49
+
"sigil",
50
+
],
51
+
]
52
+
`)
33
53
expect(callback).toHaveBeenCalledTimes(1)
34
54
35
55
// and it doesn't warn you twice
@@ -42,8 +62,46 @@ Array [
42
62
})
43
63
expect(console.error).toHaveBeenCalledTimes(0)
44
64
expect(callback).toHaveBeenCalledTimes(1)
65
+
})
45
66
46
-
console.error.mockRestore()
67
+
test('async act recovers from async errors',async()=>{
"It looks like you're using a version of react-dom that supports the \\"act\\" function, but not an awaitable version of \\"act\\" which you will need. Please upgrade to at least [email protected] to remove this warning.",
81
+
],
82
+
Array [
83
+
"call console.error",
84
+
],
85
+
]
86
+
`)
87
+
})
88
+
89
+
test('async act recovers from sync errors',async()=>{
0 commit comments