cleanup
This commit is contained in:
parent
afcecc50ac
commit
7742d5cd21
2 changed files with 5 additions and 20 deletions
|
@ -2,9 +2,7 @@ const fs = require('fs')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const spawn = require('child_process').spawn
|
const spawn = require('child_process').spawn
|
||||||
|
|
||||||
const projectRoot = path.normalize(path.join(__dirname, '..'))
|
|
||||||
const outputLog = path.join(projectRoot, '.test-failures.log')
|
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.
|
// Start with a fresh output log on each run.
|
||||||
if (fs.existsSync(outputLog)) {
|
if (fs.existsSync(outputLog)) {
|
||||||
|
@ -12,23 +10,9 @@ if (fs.existsSync(outputLog)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run all tests, specifying the collector script.
|
// Run all tests, specifying the collector script.
|
||||||
spawn(
|
spawn('lerna', ['run', '--no-bail', 'testci', '--loglevel', 'error', '--', '--no-warnings'], {
|
||||||
'lerna',
|
stdio: 'inherit',
|
||||||
[
|
}).on('exit', function (code) {
|
||||||
'run',
|
|
||||||
'--no-bail',
|
|
||||||
'testci',
|
|
||||||
'--loglevel',
|
|
||||||
'error',
|
|
||||||
'--',
|
|
||||||
// '--reporter',
|
|
||||||
// 'min'
|
|
||||||
// '--reporter',
|
|
||||||
// `${collectorScript}`,
|
|
||||||
'--no-warnings',
|
|
||||||
],
|
|
||||||
{ stdio: 'inherit' }
|
|
||||||
).on('exit', function (code) {
|
|
||||||
// If a failure occurred, the log file will have been created. Print it.
|
// If a failure occurred, the log file will have been created. Print it.
|
||||||
if (fs.existsSync(outputLog)) {
|
if (fs.existsSync(outputLog)) {
|
||||||
console.error(fs.readFileSync(outputLog, 'utf8').trim())
|
console.error(fs.readFileSync(outputLog, 'utf8').trim())
|
||||||
|
|
|
@ -28,6 +28,7 @@ class TerseReporter {
|
||||||
console.log(`FAIL: ${test.fullTitle()}`)
|
console.log(`FAIL: ${test.fullTitle()}`)
|
||||||
console.log(err)
|
console.log(err)
|
||||||
|
|
||||||
|
// save for adding to an output file
|
||||||
failuresPerFile[this.currentTest.file] = failuresPerFile[this.currentTest.file] || []
|
failuresPerFile[this.currentTest.file] = failuresPerFile[this.currentTest.file] || []
|
||||||
failuresPerFile[this.currentTest.file].push(this.currentTest)
|
failuresPerFile[this.currentTest.file].push(this.currentTest)
|
||||||
})
|
})
|
||||||
|
@ -50,7 +51,7 @@ class TerseReporter {
|
||||||
// Print each failure.
|
// Print each failure.
|
||||||
failures.forEach(function (failure, i) {
|
failures.forEach(function (failure, i) {
|
||||||
const stack = failure.err.stack.split('\n')
|
const stack = failure.err.stack.split('\n')
|
||||||
writeLine(`${file}: ${i + 1}\) ${failure.title}:`)
|
writeLine(`${file}: ${i + 1}) ${failure.title}:`)
|
||||||
writeLine(`${file}:`)
|
writeLine(`${file}:`)
|
||||||
writeLine(`${file}: ${red(stack[0].trim())}`)
|
writeLine(`${file}: ${red(stack[0].trim())}`)
|
||||||
writeLine(`${file}: ${green('+ expected')} ${red('- actual')}`)
|
writeLine(`${file}: ${green('+ expected')} ${red('- actual')}`)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue