File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -2112,8 +2112,10 @@ added: v22.3.0
2112
2112
2113
2113
This function is used to mock the exports of ECMAScript modules, CommonJS
2114
2114
modules, and Node.js builtin modules. Any references to the original module
2115
- prior to mocking are not impacted. The following example demonstrates how a mock
2116
- is created for a module.
2115
+ prior to mocking are not impacted. In order to enable module mocking, Node.js must
2116
+ be started with the [ ` --experimental-test-module-mocks ` ] [ ] command-line flag.
2117
+
2118
+ The following example demonstrates how a mock is created for a module.
2117
2119
2118
2120
``` js
2119
2121
test (' mocks a builtin module in both module systems' , async (t ) => {
@@ -3561,6 +3563,7 @@ Can be used to abort test subtasks when the test has been aborted.
3561
3563
3562
3564
[ TAP ] : https://testanything.org/
3563
3565
[ `--experimental-test-coverage` ] : cli.md#--experimental-test-coverage
3566
+ [ `--experimental-test-module-mocks` ] : cli.md#--experimental-test-module-mocks
3564
3567
[ `--experimental-test-snapshots` ] : cli.md#--experimental-test-snapshots
3565
3568
[ `--import` ] : cli.md#--importmodule
3566
3569
[ `--test-concurrency` ] : cli.md#--test-concurrency
You can’t perform that action at this time.
0 commit comments