js-waku
js-waku copied to clipboard
fix: improve error handling
This is a bug report
Problem
For our tests suite, we sometimes get vague generic errors from Allure that don't convey any directed information about the origin of the error such as:
1) Uncaught error outside test suite
Error: No active suite
at AllureReporter.startCase (/home/runner/work/js-waku/js-waku/node_modules/allure-mocha/src/AllureReporter.ts:95:13)
at AllureReporter.failTestCase (/home/runner/work/js-waku/js-waku/node_modules/allure-mocha/src/AllureReporter.ts:139:12)
at MochaAllureReporter.onFailed (/home/runner/work/js-waku/js-waku/node_modules/allure-mocha/src/MochaAllureReporter.ts:82:23)
at ParallelBufferedRunner.emit (node:events:529:35)
at ParallelBufferedRunner.emit (node:domain:489:12)
at ParallelBufferedRunner.Runner.fail (/home/runner/work/js-waku/js-waku/node_modules/mocha/lib/runner.js:453:8)
at ParallelBufferedRunner.Runner._uncaught (/home/runner/work/js-waku/js-waku/node_modules/mocha/lib/runner.js:983:12)
at /home/runner/work/js-waku/js-waku/node_modules/mocha/lib/nodejs/parallel-buffered-runner.js:340:18
at Array.forEach (<anonymous>)
at /home/runner/work/js-waku/js-waku/node_modules/mocha/lib/nodejs/parallel-buffered-runner.js:333:12
at processTicksAndRejections (node:internal/process/task_queues:95:5)
npm ERR! Lifecycle script `test:node` failed with error:
npm ERR! Error: command failed
npm ERR! in workspace: @waku/[email protected]
npm ERR! at location: /home/runner/work/js-waku/js-waku/packages/discovery
Proposed Solutions
Ensure we have access to stack trace
Notes
Ref: https://github.com/waku-org/js-waku/actions/runs/8110738684/job/22168594550?pr=1876
cc @fbarbu15