From a93830c9fd526983bf14cbb891c13ebf1ef9eb4e Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 13 Mar 2018 14:08:56 +0200 Subject: [PATCH] saucelabs-unit-test.js: tweak failed tests message (#25836) --- build/saucelabs-unit-test.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/saucelabs-unit-test.js b/build/saucelabs-unit-test.js index 95b68345c076..5a0142e033ab 100644 --- a/build/saucelabs-unit-test.js +++ b/build/saucelabs-unit-test.js @@ -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')