From d2ce25b06346fbe5946eb99198327be2fd43c470 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hua=CC=81ng=20Ju=CC=80nlia=CC=80ng?= Date: Mon, 5 Nov 2018 14:19:55 +0800 Subject: [PATCH] Move from "process.exit" to "exit" This is a follow-up to https://github.com/facebook/jest/pull/5313 --- packages/jest-worker/package.json | 1 + packages/jest-worker/src/workers/processChild.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/jest-worker/package.json b/packages/jest-worker/package.json index f6789815c3d6..39370ad97b66 100644 --- a/packages/jest-worker/package.json +++ b/packages/jest-worker/package.json @@ -10,6 +10,7 @@ "main": "build/index.js", "types": "build/index.d.ts", "dependencies": { + "exit": "^0.1.2", "merge-stream": "^1.0.1", "supports-color": "^6.1.0" }, diff --git a/packages/jest-worker/src/workers/processChild.ts b/packages/jest-worker/src/workers/processChild.ts index beb395af1a22..5bdc3647b63d 100644 --- a/packages/jest-worker/src/workers/processChild.ts +++ b/packages/jest-worker/src/workers/processChild.ts @@ -5,6 +5,10 @@ * LICENSE file in the root directory of this source tree. */ +'use strict'; + +import exit from 'exit'; + import { CHILD_MESSAGE_CALL, CHILD_MESSAGE_END, @@ -106,7 +110,7 @@ function end(): void { } function exitProcess(): void { - process.exit(0); + exit(0); } function execMethod(method: string, args: Array): void {