-
Notifications
You must be signed in to change notification settings - Fork 2
/
react-dom-test-utils.development.js.patch
42 lines (39 loc) · 1.1 KB
/
react-dom-test-utils.development.js.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--- node_modules/react-dom/cjs/react-dom-test-utils.development.js 2022-06-22 09:44:47.000000000 -0400
+++ react-dom-test-utils.development.js 2022-06-22 09:44:53.000000000 -0400
@@ -996,15 +996,19 @@
return didFlushWork;
};
-function flushWorkAndMicroTasks(onDone) {
+function flushWorkAndMicroTasks(onDone, ex) {
try {
flushWork();
enqueueTask(function () {
+ try {
if (flushWork()) {
flushWorkAndMicroTasks(onDone);
} else {
onDone();
}
+ } catch (err) {
+ throw ex || err;
+ }
});
} catch (err) {
onDone(err);
@@ -1064,6 +1068,9 @@
// effects and microtasks in a loop until flushPassiveEffects() === false,
// and cleans up
+ const {testPath, currentTestName} = expect.getState();
+ const ex = new Error(`${testPath}::${currentTestName}`);
+ ex.name = 'Test Failed';
return {
then: function (resolve, reject) {
@@ -1085,7 +1092,7 @@
} else {
resolve();
}
- });
+ }, ex);
}, function (err) {
onDone();
reject(err);