Commit 516c775 1 parent 6d42e44 commit 516c775 Copy full SHA for 516c775
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 @@ -2104,8 +2104,10 @@ added: v22.3.0
2104
2104
2105
2105
This function is used to mock the exports of ECMAScript modules, CommonJS
2106
2106
modules, and Node.js builtin modules. Any references to the original module
2107
- prior to mocking are not impacted. The following example demonstrates how a mock
2108
- is created for a module.
2107
+ prior to mocking are not impacted. In order to enable module mocking, Node.js must
2108
+ be started with the [ ` --experimental-test-module-mocks ` ] [ ] command-line flag.
2109
+
2110
+ The following example demonstrates how a mock is created for a module.
2109
2111
2110
2112
``` js
2111
2113
test (' mocks a builtin module in both module systems' , async (t ) => {
@@ -3551,6 +3553,7 @@ Can be used to abort test subtasks when the test has been aborted.
3551
3553
[ TAP ] : https://testanything.org/
3552
3554
[ TTY ] : tty.md
3553
3555
[ `--experimental-test-coverage` ] : cli.md#--experimental-test-coverage
3556
+ [ `--experimental-test-module-mocks` ] : cli.md#--experimental-test-module-mocks
3554
3557
[ `--experimental-test-snapshots` ] : cli.md#--experimental-test-snapshots
3555
3558
[ `--import` ] : cli.md#--importmodule
3556
3559
[ `--test-concurrency` ] : cli.md#--test-concurrency
You can’t perform that action at this time.
0 commit comments