diff --git a/tests/mocha/index.html b/tests/mocha/index.html index d4d40331441..694d5215aac 100644 --- a/tests/mocha/index.html +++ b/tests/mocha/index.html @@ -18,9 +18,9 @@ } -
+ @@ -173,10 +173,16 @@ diff --git a/tests/mocha/run_mocha_tests_in_browser.js b/tests/mocha/run_mocha_tests_in_browser.js index d4dc83fbe5e..217c9992bc6 100644 --- a/tests/mocha/run_mocha_tests_in_browser.js +++ b/tests/mocha/run_mocha_tests_in_browser.js @@ -61,8 +61,18 @@ async function runMochaTestsInBrowser() { const elem = await browser.$('#failureCount'); const numOfFailure = await elem.getAttribute('tests_failed'); + if (numOfFailure > 0) { + console.log('============Blockly Mocha Test Failures================') + const failureMessagesEls = await browser.$$('#failureMessages p'); + if (!failureMessagesEls.length) { + console.log('There is at least one test failure, but no messages reported. Mocha may be failing because no tests are being run.'); + } + for (let el of failureMessagesEls) { + console.log(await el.getText()); + } + } + console.log('============Blockly Mocha Test Summary================='); - console.log(numOfFailure); console.log(numOfFailure + ' tests failed'); console.log('============Blockly Mocha Test Summary================='); if (parseInt(numOfFailure) !== 0) {