fix terser reporter
This commit is contained in:
parent
23fa1fdb9d
commit
1200bea79c
1 changed files with 5 additions and 4 deletions
|
@ -2,7 +2,7 @@ const Mocha = require('mocha')
|
|||
const { EVENT_TEST_FAIL, EVENT_RUN_END } = Mocha.Runner.constants
|
||||
|
||||
const path = require('path')
|
||||
const projectRoot = path.normalize(path.join(__dirname, '..'))
|
||||
const projectRoot = path.normalize(path.join(__dirname, '../..'))
|
||||
const outputLog = path.join(projectRoot, '.test-failures.log')
|
||||
|
||||
const red = function (string) {
|
||||
|
@ -26,11 +26,12 @@ class TerseReporter {
|
|||
runner.on(EVENT_TEST_FAIL, (test, err) => {
|
||||
// output to the console
|
||||
console.log(`FAIL: ${test.fullTitle()}`)
|
||||
console.log(err)
|
||||
console.error(err)
|
||||
|
||||
// save for adding to an output file
|
||||
failuresPerFile[this.currentTest.file] = failuresPerFile[this.currentTest.file] || []
|
||||
failuresPerFile[this.currentTest.file].push(this.currentTest)
|
||||
test.err = err
|
||||
failuresPerFile[test.file] = failuresPerFile[test.file] || []
|
||||
failuresPerFile[test.file].push(test)
|
||||
})
|
||||
|
||||
runner.on(EVENT_RUN_END, () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue