fix(testrunner): return correct exit code (#474)
This commit is contained in:
parent
61ca679cd9
commit
98bf9ac1d5
|
|
@ -121,6 +121,6 @@ new Reporter(testRunner, {
|
||||||
|
|
||||||
// await utils.initializeFlakinessDashboardIfNeeded(testRunner);
|
// await utils.initializeFlakinessDashboardIfNeeded(testRunner);
|
||||||
testRunner.run().then(result => {
|
testRunner.run().then(result => {
|
||||||
process.exit(result.terminationError ? 130 : 0);
|
process.exit(result.exitCode);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -399,10 +399,17 @@ class TestRunner extends EventEmitter {
|
||||||
const result = {};
|
const result = {};
|
||||||
if (termination) {
|
if (termination) {
|
||||||
result.result = termination.result;
|
result.result = termination.result;
|
||||||
|
result.exitCode = 130;
|
||||||
result.terminationMessage = termination.message;
|
result.terminationMessage = termination.message;
|
||||||
result.terminationError = termination.error;
|
result.terminationError = termination.error;
|
||||||
} else {
|
} else {
|
||||||
result.result = this.failedTests().length ? TestResult.Failed : TestResult.Ok;
|
if (this.failedTests().length) {
|
||||||
|
result.result = TestResult.Failed;
|
||||||
|
result.exitCode = 1;
|
||||||
|
} else {
|
||||||
|
result.result = TestResult.Ok;
|
||||||
|
result.exitCode = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.emit(TestRunner.Events.Finished, result);
|
this.emit(TestRunner.Events.Finished, result);
|
||||||
if (session)
|
if (session)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue