]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
saucelabs-unit-test.js: tweak failed tests message (#25836)
authorXhmikosR <xhmikosr@gmail.com>
Tue, 13 Mar 2018 12:08:56 +0000 (14:08 +0200)
committerGitHub <noreply@github.com>
Tue, 13 Mar 2018 12:08:56 +0000 (14:08 +0200)
build/saucelabs-unit-test.js

index 95b68345c07643e2a54b9d2c65a25ae0de56d5bd..5a0142e033abd964f152498b9d66fd903b2ccc0a 100644 (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')