0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-17 09:52:29 +01:00

saucelabs-unit-test.js: tweak failed tests message (#25836)

This commit is contained in:
XhmikosR 2018-03-13 14:08:56 +02:00 committed by GitHub
parent 2c41b0aea6
commit a93830c9fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}
@ -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')