Skip to content

Commit 039ae18

Browse files
committed
fix: timeout signal used for all restarts
1 parent 3bafff6 commit 039ae18

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/jest/src/harness.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const getHarnessInternal = async (
3939
throw new DOMException('The operation was aborted', 'AbortError');
4040
}
4141

42-
const restart = () =>
42+
const initialRestart = () =>
4343
new Promise<void>((resolve, reject) => {
4444
signal.addEventListener('abort', () => {
4545
reject(new DOMException('The operation was aborted', 'AbortError'));
@@ -51,12 +51,18 @@ const getHarnessInternal = async (
5151

5252
// Wait for the bridge to be ready
5353
try {
54-
await restart();
54+
await initialRestart();
5555
} catch (error) {
5656
await dispose();
5757
throw error;
5858
}
5959

60+
const restart = () =>
61+
new Promise<void>((resolve, reject) => {
62+
serverBridge.once('ready', () => resolve());
63+
platformInstance.restartApp().catch(reject);
64+
});
65+
6066
return {
6167
runTests: async (path, options) => {
6268
const client = serverBridge.rpc.clients.at(-1);

0 commit comments

Comments
 (0)