Skip to content

Commit

Permalink
saucelabs-unit-test.js: tweak failed tests message (twbs#25836)
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Mar 13, 2018
1 parent 2c41b0a commit a93830c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build/saucelabs-unit-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const waitingCallback = (error, body, id) => {
console.log(`Platform: ${test.platform.join(', ')}`)
console.log(`Passed: ${passed.toString()}`)
console.log(`URL: ${test.url}\n`)

if (errorStr) {
console.error(errorStr)
}
Expand All @@ -71,8 +72,8 @@ const waitingCallback = (error, body, id) => {
if (jobsDone === browsersFile.length - 1) {
jsUnitSaucelabs.stop()
if (jobsDone > jobsSucceeded) {
const failedTest = jobsDone - jobsSucceeded
throw new Error(`Some test(s) failed (${failedTest})`)
const failedTests = jobsDone - jobsSucceeded
throw new Error(`${failedTests} test${failedTests > 1 ? 's' : ''} failed.`)
}

console.log('All tests passed')
Expand Down

0 comments on commit a93830c

Please sign in to comment.