From 934d73e526c0d55da6ca4b42f7773cb6f6ac1c5f Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Tue, 16 Jul 2019 16:34:41 -0700 Subject: [PATCH] fix(testreporter): Test Reporter should not terminate node.js process (#4716) This patch starts assigning process exit codes rather than terminating parent process. Library should never own/terminate parent node.js process. --- utils/testrunner/Reporter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/testrunner/Reporter.js b/utils/testrunner/Reporter.js index 9edacdd21b8..3455b4e8dff 100644 --- a/utils/testrunner/Reporter.js +++ b/utils/testrunner/Reporter.js @@ -80,13 +80,13 @@ class Reporter { description = `${RED_COLOR}${RESET_COLOR}`; console.log(` ${workerId}: [${description}] ${test.fullName} (${formatTestLocation(test)})`); } - process.exit(2); + process.exitCode = 2; } _onFinished() { this._printTestResults(); const failedTests = this._runner.failedTests(); - process.exit(failedTests.length > 0 ? 1 : 0); + process.exitCode = failedTests.length > 0 ? 1 : 0; } _printTestResults() {