When used with mocha the errors are displayed twice. Is there a way to have it only display once?
const AggregateError = require('aggregate-error')
it('should fail', function() {
throw new AggregateError([
new Error('first'),
new Error('second')
])
})
The report is
1) should fail
0 passing (12ms)
1 failing
1) should fail:
Error: first
at Context.<anonymous> (/Users/williamrusnack/Documents/event_sequencing/try_aggregate-error.js:5:5)
at callFn (/Users/williamrusnack/Documents/event_sequencing/node_modules/mocha/lib/runnable.js:354:21)
at Test.Runnable.run (/Users/williamrusnack/Documents/event_sequencing/node_modules/mocha/lib/runnable.js:346:7)
at Runner.runTest (/Users/williamrusnack/Documents/event_sequencing/node_modules/mocha/lib/runner.js:442:10)
at /Users/williamrusnack/Documents/event_sequencing/node_modules/mocha/lib/runner.js:560:12
at next (/Users/williamrusnack/Documents/event_sequencing/node_modules/mocha/lib/runner.js:356:14)
at /Users/williamrusnack/Documents/event_sequencing/node_modules/mocha/lib/runner.js:366:7
at next (/Users/williamrusnack/Documents/event_sequencing/node_modules/mocha/lib/runner.js:290:14)
at Immediate.<anonymous> (/Users/williamrusnack/Documents/event_sequencing/node_modules/mocha/lib/runner.js:334:5)
Error: second
at Context.<anonymous> (/Users/williamrusnack/Documents/event_sequencing/try_aggregate-error.js:6:5)
at callFn (/Users/williamrusnack/Documents/event_sequencing/node_modules/mocha/lib/runnable.js:354:21)
at Test.Runnable.run (/Users/williamrusnack/Documents/event_sequencing/node_modules/mocha/lib/runnable.js:346:7)
at Runner.runTest (/Users/williamrusnack/Documents/event_sequencing/node_modules/mocha/lib/runner.js:442:10)
at /Users/williamrusnack/Documents/event_sequencing/node_modules/mocha/lib/runner.js:560:12
at next (/Users/williamrusnack/Documents/event_sequencing/node_modules/mocha/lib/runner.js:356:14)
at /Users/williamrusnack/Documents/event_sequencing/node_modules/mocha/lib/runner.js:366:7
at next (/Users/williamrusnack/Documents/event_sequencing/node_modules/mocha/lib/runner.js:290:14)
at Immediate.<anonymous> (/Users/williamrusnack/Documents/event_sequencing/node_modules/mocha/lib/runner.js:334:5)
AggregateError:
Error: first
at Context.<anonymous> (try_aggregate-error.js:5:5)
Error: second
at Context.<anonymous> (try_aggregate-error.js:6:5)
at Context.<anonymous> (try_aggregate-error.js:4:9)
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too