-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Description
What is the problem this feature will solve?
Currently you can't mock external or built-in modules which makes it difficult if you code imports a module that may run some side-effects and you have no control over it.
There may be some built in modules which you need to stub out but don't have access to during a test run.
What is the feature you are proposing to solve the problem?
Allowing us to use the built-in test runner to mock modules entirely.
There has already been some work in this by @cjihrig
I think the biggest things missing before I can open a PR are related to ESM loaders and are tracked in #49472 and #49473.
Both of those issues look to be resolved now, I don't know what the current blockers are for this
What alternatives have you considered?
No response
marco-ippolito, sindresorhus, cehidalgo, rdela, himself65 and 25 more
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.