-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Open
Labels
test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Description
Currently, mock.module
's options
expects defaultExport
and namedExports
separately. We are not aware of a reason to separate them, and it's inconsistent with other major testing frameworks/utilities (such as Jest).
function mock__default() {…}
function mock__foo() {…}
mock.module('example.mjs', {
- defaultExport: mock__default,
- namedExports: {
+ exports: {
+ default: mock__default,
foo: mock__foo,
},
});
The plan would be:
- Immediately introduce
options.exports
- alias
defaultExport
&namedExports
intooptions.exports
- alias
- Immediately flag
defaultExport
&namedExports
deprecated - Provide a userland-migration to automatically transform old to new
- In node 25.x remove
defaultExport
&namedExports
Metadata
Metadata
Assignees
Labels
test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Type
Projects
Status
Todo