-
Couldn't load subscription status.
- Fork 942
chore(deps): update dependency mocha to v11.7.2 #5850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5850 +/- ##
=======================================
Coverage 95.06% 95.06%
=======================================
Files 307 307
Lines 8031 8031
Branches 1627 1627
=======================================
Hits 7635 7635
Misses 396 396 🚀 New features to boost your workflow:
|
9e368d1 to
1f3466d
Compare
|
[Marc]
I understand what is happening here now.
So when We can manully see the tests pass by temporarily disabling cd experimental/packages/opentelemetry-instrumentation
node --no-experimental-require-module --experimental-loader=./hook.mjs ../../../node_modules/mocha/bin/mocha 'test/node/*.test.mjs'However, that isn't a good solution. So why doesn't this fail in Node.js v22 which also has IIUC, this added support for running ES module hooks for files loaded via I think a solution here is to patch mocha module loading (again) to skip using require(esm) if the file has a .mjs extension. The This change to [email protected] fixes this test (and, I believe, any other --- ../../../node_modules/mocha/lib/nodejs/esm-utils.js 2025-08-13 09:17:47
+++ ./node_modules/mocha/lib/nodejs/esm-utils.js 2025-08-13 12:06:44
@@ -90,6 +90,10 @@
// and `require.cache` effective, while allowing us to load ESM modules
// and CJS modules in the same way.
const requireModule = async (file, esmDecorator) => {
+ if (path.extname(file) === '.mjs') {
+ return formattedImport(file, esmDecorator);
+ }
+
try {
return require(file);
} catch (err) {I'll open a mocha PR. |
This section is not completely correct. While creating a small repro-case for my mocha bug report, I found that Node v22.15.0 does not fix the smaller repro case: https://github.com/trentm/repro-mocha-11-mjs-import-hooks-issue So there is some detail that I'm missing. I think the difference is related to my smaller repro case depending on the test file itself (test/repro.test.mjs) needing to have been hooked by the (Side note: I don't have a good alternative answer, so this amounts to just a complaint. I don't like the pile of complexity in our testing here: mocha running TypeScript test files via a runtime loader that transpiles, with mocha having internal complex logic to second guess whether files are CommonJS or ESM. Add to that that mocha runs separate test files in the same process, so they can cross-talk.) |
1f3466d to
7ed2f7a
Compare
308a36a to
a724925
Compare
a724925 to
0c4dce1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New version works now. Thank you @legendecas (original PR) and @trentm (follow-up issue) for doing the heavy lifting 🎉
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR contains the following updates:
11.1.0->11.7.2Release Notes
mochajs/mocha (mocha)
v11.7.2Compare Source
🩹 Fixes
📚 Documentation
🧹 Chores
-R import-only-loader(#5391) (6ee5b48)🤖 Automation
v11.7.1Compare Source
🩹 Fixes
🧹 Chores
v11.7.0Compare Source
🌟 Features
v11.6.0Compare Source
🌟 Features
v11.5.0Compare Source
🌟 Features
v11.4.0Compare Source
🌟 Features
📚 Documentation
v11.3.0Compare Source
🌟 Features
📚 Documentation
🧹 Chores
v11.2.2Compare Source
🩹 Fixes
📚 Documentation
v11.2.1Compare Source
🩹 Fixes
📚 Documentation
🧹 Chores
v11.2.0Compare Source
🌟 Features
📚 Documentation
🧹 Chores
fs-extrawith newerfsbuilt-ins (#5284) (75dcf8c)Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.