-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
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&namedExportsintooptions.exports
- alias
- Immediately flag
defaultExport&namedExportsdeprecated - Provide a userland-migration to automatically transform old to new
- In node 25.x remove
defaultExport&namedExports
filmaj
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