Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 516c775

Browse filesBrowse files
textbooktargos
authored andcommitted
doc: cover --experimental-test-module-mocks flag
PR-URL: #55021 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 6d42e44 commit 516c775
Copy full SHA for 516c775

File tree

Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed
Open diff view settings
Collapse file

‎doc/api/test.md‎

Copy file name to clipboardExpand all lines: doc/api/test.md
+5-2Lines changed: 5 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -2104,8 +2104,10 @@ added: v22.3.0
21042104

21052105
This function is used to mock the exports of ECMAScript modules, CommonJS
21062106
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.
21092111

21102112
```js
21112113
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.
35513553
[TAP]: https://testanything.org/
35523554
[TTY]: tty.md
35533555
[`--experimental-test-coverage`]: cli.md#--experimental-test-coverage
3556+
[`--experimental-test-module-mocks`]: cli.md#--experimental-test-module-mocks
35543557
[`--experimental-test-snapshots`]: cli.md#--experimental-test-snapshots
35553558
[`--import`]: cli.md#--importmodule
35563559
[`--test-concurrency`]: cli.md#--test-concurrency

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.