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.
This commit is contained in:
Andrey Lushnikov 2019-07-16 16:34:41 -07:00 committed by GitHub
parent eea55bd6c6
commit 934d73e526
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,13 +80,13 @@ class Reporter {
description = `${RED_COLOR}<UNKNOWN>${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() {