Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/api/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -2508,6 +2508,11 @@ Node.js builtin modules. Any references to the original module prior to mocking
order to enable module mocking, Node.js must be started with the
[`--experimental-test-module-mocks`][] command-line flag.

**Note**: [module customization hooks][] registered via the **synchronous** API effect resolution of
the `specifier` provided to `mock.module`. Customization hooks registered via the **asynchronous**
API are currently ignored (because the test runner's loader is synchronous, and node does not
support multi-chain / cross-chain loading).

The following example demonstrates how a mock is created for a module.

```js
Expand Down Expand Up @@ -4255,6 +4260,7 @@ Can be used to abort test subtasks when the test has been aborted.
[configuration files]: cli.md#--experimental-config-fileconfig
[describe options]: #describename-options-fn
[it options]: #testname-options-fn
[module customization hooks]: module.md#customization-hooks
[running tests from the command line]: #running-tests-from-the-command-line
[stream.compose]: stream.md#streamcomposestreams
[subtests]: #subtests
Expand Down
Loading