There are two bug reports in this reporduceable example:
Steps:
First, run the tests in sequential mode:
-
Run
npx mocha test-without-hooks.js
-
Run
npm run open-reports
ornpx allure-generate clean && npx allure open
Observe the following correct results in the report:
- One test passes (in green)
- One test is broken (in yellow) due to a thrown Error.
- One test is failed (in red) due to an AssertionError thrown by Chai expect.
Next, run the same test in parallel mode:
-
Run
npx mocha -p test-without-hooks.js
-
Run
npm run open-reports
ornpx allure-generate clean && npx allure open
Observe the following results in the report:
- One test passes (in green)
- One test is broken (in yellow) due to a thrown Error.
- One test is failed, due to an AssertionError thrown by Chai expect. However, it appears incorrectly in yellow.
Steps:
-
Run
npx mocha -p test-with-hooks.js
-
Run
npm run open-reports
ornpx allure-generate clean && npx allure open
There is a failure reported outside the test suite:
1) Uncaught error outside test suite:
Uncaught TypeError: hook.error is not a function
at MochaAllureReporter.onHookEnd (node_modules/allure-mocha/dist/MochaAllureReporter.js:72:40)
at ParallelBufferedRunner.emit (node:events:539:35)
at processTicksAndRejections (node:internal/process/task_queues:96:5)