test: enable --allow-uncaught in mocha runs#7575
test: enable --allow-uncaught in mocha runs#7575gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits intomasterfrom
Conversation
Add --allow-uncaught to mocha-based test scripts in package.json so uncaught errors are treated as fatal instead of being absorbed by mocha. Update the direct mocha invocation in platform.yml to match script behavior for CI jobs that do not go through npm/yarn test scripts.
Overall package sizeSelf size: 4.68 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.6 | 81.92 kB | 813.08 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7575 +/- ##
=======================================
Coverage 80.29% 80.29%
=======================================
Files 732 732
Lines 31468 31468
=======================================
+ Hits 25266 25267 +1
+ Misses 6202 6201 -1 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-02-19 11:23:03 Comparing candidate commit ea8a2d0 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 228 metrics, 32 unstable metrics. |
BridgeAR
left a comment
There was a problem hiding this comment.
Please move this option into the mocharc file. That way we only need to list it once instead of on each script
Configure allowUncaught in .mocharc.js and remove duplicated --allow-uncaught flags from test scripts and workflow invocation. This keeps mocha behavior consistent while reducing script noise. Co-authored-by: Cursor <cursoragent@cursor.com>
| module.exports = { | ||
| allowUncaught: true, | ||
| color: true, | ||
| exit: true, |
There was a problem hiding this comment.
Independent: we should likely remove this option. It might actually hide issues https://mochajs.org/running/cli/#--exit
This comment has been minimized.
This comment has been minimized.
|
/merge -m "test: fail mocha tests for uncaught exceptions Set 'allowUncaught: true' in our mocharc file" |
|
View all feedbacks in Devflow UI.
Set 'allowUncaught: true' in our mocharc file"`
Set 'allowUncaught: true' in our mocharc file"`* Arguments errors:
If you need support, contact us on Slack #devflow with those details! |
378da78
into
master
test: enable --allow-uncaught in mocha runs Add --allow-uncaught to mocha-based test scripts in package.json so uncaught errors are treated as fatal instead of being absorbed by mocha. Update the direct mocha invocation in platform.yml to match script behavior for CI jobs that do not go through npm/yarn test scripts. refactor(test): centralize mocha allow-uncaught flag Configure allowUncaught in .mocharc.js and remove duplicated --allow-uncaught flags from test scripts and workflow invocation. This keeps mocha behavior consistent while reducing script noise. Co-authored-by: Cursor <cursoragent@cursor.com> Merge branch 'master' into watson/mocha-abort-on-uncaught Co-authored-by: thomas.watson <thomas.watson@datadoghq.com>
test: enable --allow-uncaught in mocha runs Add --allow-uncaught to mocha-based test scripts in package.json so uncaught errors are treated as fatal instead of being absorbed by mocha. Update the direct mocha invocation in platform.yml to match script behavior for CI jobs that do not go through npm/yarn test scripts. refactor(test): centralize mocha allow-uncaught flag Configure allowUncaught in .mocharc.js and remove duplicated --allow-uncaught flags from test scripts and workflow invocation. This keeps mocha behavior consistent while reducing script noise. Co-authored-by: Cursor <cursoragent@cursor.com> Merge branch 'master' into watson/mocha-abort-on-uncaught Co-authored-by: thomas.watson <thomas.watson@datadoghq.com>

What does this PR do?
Updates Mocha-based test execution to use
--allow-uncaughtso uncaught exceptions are no longer absorbed by Mocha and instead fail fast by propagating to the process. This change applies to the repo's Mocha test scripts inpackage.jsonand to a direct Mocha invocation in.github/workflows/platform.ymlthat does not go through those scripts.Motivation
Ensure errors do not go unnoticed.