From f6c20ab4d653e3058e559852bd00eb44a80f8560 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 22 Sep 2021 17:04:46 -0500 Subject: [PATCH] fix: only throw timed out error if timed out (#435) --- packages/jest-dev-server/src/global.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/jest-dev-server/src/global.js b/packages/jest-dev-server/src/global.js index e3ffc502..54054cf0 100644 --- a/packages/jest-dev-server/src/global.js +++ b/packages/jest-dev-server/src/global.js @@ -207,10 +207,14 @@ async function setupJestServer(providedConfig, index) { try { await waitOn(opts) } catch (err) { - throw new JestDevServerError( - `Server has taken more than ${launchTimeout}ms to start.`, - ERROR_TIMEOUT, - ) + if (err.message.startsWith("Timed out")) { + throw new JestDevServerError( + `Server has taken more than ${launchTimeout}ms to start.`, + ERROR_TIMEOUT, + ) + } + + throw err; } } }