diff --git a/scripts/testall.js b/scripts/testall.js index 88a9f64c6e8..1f33a7f70d5 100644 --- a/scripts/testall.js +++ b/scripts/testall.js @@ -2,9 +2,7 @@ const fs = require('fs') const path = require('path') const spawn = require('child_process').spawn -const projectRoot = path.normalize(path.join(__dirname, '..')) const outputLog = path.join(projectRoot, '.test-failures.log') -const collectorScript = path.join(projectRoot, 'tests', 'reporters', 'terser.js') // Start with a fresh output log on each run. if (fs.existsSync(outputLog)) { @@ -12,23 +10,9 @@ if (fs.existsSync(outputLog)) { } // Run all tests, specifying the collector script. -spawn( - 'lerna', - [ - 'run', - '--no-bail', - 'testci', - '--loglevel', - 'error', - '--', - // '--reporter', - // 'min' - // '--reporter', - // `${collectorScript}`, - '--no-warnings', - ], - { stdio: 'inherit' } -).on('exit', function (code) { +spawn('lerna', ['run', '--no-bail', 'testci', '--loglevel', 'error', '--', '--no-warnings'], { + stdio: 'inherit', +}).on('exit', function (code) { // If a failure occurred, the log file will have been created. Print it. if (fs.existsSync(outputLog)) { console.error(fs.readFileSync(outputLog, 'utf8').trim()) diff --git a/tests/reporters/terse.js b/tests/reporters/terse.js index 2f0bf449b84..e7cf9b85dfa 100644 --- a/tests/reporters/terse.js +++ b/tests/reporters/terse.js @@ -28,6 +28,7 @@ class TerseReporter { console.log(`FAIL: ${test.fullTitle()}`) console.log(err) + // save for adding to an output file failuresPerFile[this.currentTest.file] = failuresPerFile[this.currentTest.file] || [] failuresPerFile[this.currentTest.file].push(this.currentTest) }) @@ -50,7 +51,7 @@ class TerseReporter { // Print each failure. failures.forEach(function (failure, i) { const stack = failure.err.stack.split('\n') - writeLine(`${file}: ${i + 1}\) ${failure.title}:`) + writeLine(`${file}: ${i + 1}) ${failure.title}:`) writeLine(`${file}:`) writeLine(`${file}: ${red(stack[0].trim())}`) writeLine(`${file}: ${green('+ expected')} ${red('- actual')}`)