From b52b8c61fe8d762e5e9915cdeacf3c7d5fbf5e7f Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Thu, 28 Feb 2019 13:31:12 +0100 Subject: [PATCH] no finally --- packages/jest-circus/src/utils.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/jest-circus/src/utils.ts b/packages/jest-circus/src/utils.ts index 45d93fc2286e..0aef29cdbd64 100644 --- a/packages/jest-circus/src/utils.ts +++ b/packages/jest-circus/src/utils.ts @@ -231,19 +231,18 @@ export const callAsyncCircusFn = ( return resolve(); }) .then(() => { + completed = true; // If timeout is not cleared/unrefed the node process won't exit until // it's resolved. timeoutID.unref && timeoutID.unref(); clearTimeout(timeoutID); }) .catch(error => { + completed = true; timeoutID.unref && timeoutID.unref(); clearTimeout(timeoutID); throw error; }) - .finally(() => { - completed = true; - }); }; export const getTestDuration = (test: TestEntry): number | null => {