Add information about failed tests

This commit is contained in:
Johann-S 2017-10-10 11:50:55 +02:00
parent 64c944bca8
commit da22bce2f0
1 changed files with 7 additions and 1 deletions

View File

@ -70,7 +70,13 @@ const waitingCallback = (error, body, id) => {
// Exit
if (jobsDone === browsersFile.length - 1) {
jsUnitSaucelabs.stop()
process.exit(jobsDone === jobsSucceeded ? 0 : 1)
if (jobsDone > jobsSucceeded) {
const failedTest = jobsDone - jobsSucceeded
throw new Error(`Some test(s) failed (${failedTest})`)
}
console.log('All tests passed')
process.exit(0)
}
}
}