Skip to content

Remove unnecessary quibble loader registration#11256

Merged
aduth merged 1 commit intomainfrom
aduth-unnecessary-quibble-loader
Sep 18, 2024
Merged

Remove unnecessary quibble loader registration#11256
aduth merged 1 commit intomainfrom
aduth-unnecessary-quibble-loader

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Sep 18, 2024

🛠 Summary of changes

Updates how we use quibble for JavaScript module substitution in tests to avoid explicitly passing loader option to Mocha.

This resolves a warning that's logged when running tests, and will likely help avoid a future incompatibility when Node.js removes the --loader flag:

(node:34551) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("quibble", pathToFileURL("./"));'
(Use `node --trace-warnings ...` to show where the warning was created)

It's no longer necessary to pass the loader option in newer versions of Node.js, because Quibble ✨ automagically ✨ registers the hooks behind the scenes.

For versions larger or equal to v20.6.0, there is no need to specify a --loader, as registering the loader happens automatically once you use the API.

https://github.com/testdouble/quibble#es-modules-support

📜 Testing Plan

Verify build passes.

Verify yarn test passes, and doesn't log the warning shown above.

changelog: Internal, Automated Testing, Remove unnecessary quibble loader registration
@aduth aduth merged commit f982fda into main Sep 18, 2024
@aduth aduth deleted the aduth-unnecessary-quibble-loader branch September 18, 2024 14:33
AShukla-GSA pushed a commit that referenced this pull request Sep 30, 2024
changelog: Internal, Automated Testing, Remove unnecessary quibble loader registration
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.

2 participants