Skip to content

fix(junit): report suite hook failures#5656

Open
morgan-coded wants to merge 1 commit into
codeceptjs:4.xfrom
morgan-coded:fix/5645-junit-suite-hook-failures
Open

fix(junit): report suite hook failures#5656
morgan-coded wants to merge 1 commit into
codeceptjs:4.xfrom
morgan-coded:fix/5645-junit-suite-hook-failures

Conversation

@morgan-coded

Copy link
Copy Markdown

Fixes #5645.

The JUnit reporter was building XML only from result.tests, which misses failures from suite-level Mocha hooks such as BeforeSuite, AfterSuite, and helper suite hooks.

This follows the Mocha runner fail event approach that mirao described on the issue.

This captures those suite-level hook failures from Mocha's runner fail event and adds them as failed testcase entries before the XML is built, while leaving per-test hook failures alone because those are already reported through normal test results.

Verified with:

npx mocha test/unit/junitReporter_test.js --reporter @testomatio/reporter/mocha --timeout 10000

npm run lint

npm run test:unit

npm run test:runner

Copilot AI review requested due to automatic review settings July 3, 2026 15:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4.x: junitReporter doesn't record Before/After suite failures

2 participants