test: do not hide mocha errors for nested suites - #8164
Conversation
Overall package sizeSelf size: 5.67 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.0.1 | 82.56 kB | 817.39 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 56e0115 | Docs | Datadog PR Page | Give us feedback! |
BenchmarksBenchmark execution time: 2026-04-29 14:41:03 Comparing candidate commit 56e0115 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 1345 metrics, 99 unstable metrics. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c15aeb6a86
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
BridgeAR
left a comment
There was a problem hiding this comment.
This is all a bit brittle but probably worth it 😅
* test: do not hide mocha errors for nested suites * add codeonwers
* test: do not hide mocha errors for nested suites * add codeonwers
What does this PR do?
This is similar to what PR 8147 addressed: a teardown failure can hide or distract from the original failure. The same issue also happens with nested suites, where an outer
after/afterEachhook can be reported after a failure inside an innerdescribe().Motivation
Simplified the
mocha-hookby changing the monkey patch from wrappingafterAll/afterEachhooks to patchingRunner.prototype.fail. This lets us cover both flat and nested suites cases with the same logic