mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 12:44:22 +00:00
fix(test): drain macrotasks via setTimeout, not setImmediate
setImmediate is a Node global not declared in the frontend's DOM tsconfig, so tsc --noEmit failed with 'Cannot find name setImmediate'. setTimeout is universally typed and still flushes React's pending setImmediate: looping the awaits keeps afterEach unresolved across several event-loop iterations, so the queued check-phase callback fires while window still exists.
This commit is contained in:
parent
eee5e8f6b6
commit
48f470c465
1 changed files with 1 additions and 1 deletions
|
|
@ -71,6 +71,6 @@ afterEach(async () => {
|
||||||
* one behind the first.
|
* one behind the first.
|
||||||
*/
|
*/
|
||||||
for (let i = 0; i < 3; i += 1) {
|
for (let i = 0; i < 3; i += 1) {
|
||||||
await new Promise((resolve) => setImmediate(resolve));
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue