File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -2500,6 +2500,11 @@ Node.js builtin modules. Any references to the original module prior to mocking
25002500order to enable module mocking, Node.js must be started with the
25012501[ ` --experimental-test-module-mocks ` ] [ ] command-line flag.
25022502
2503+ ** Note** : [ module customization hooks] [ ] registered via the ** synchronous** API effect resolution of
2504+ the ` specifier ` provided to ` mock.module ` . Customization hooks registered via the ** asynchronous**
2505+ API are currently ignored (because the test runner's loader is synchronous, and node does not
2506+ support multi-chain / cross-chain loading).
2507+
25032508The following example demonstrates how a mock is created for a module.
25042509
25052510``` js
@@ -4247,6 +4252,7 @@ Can be used to abort test subtasks when the test has been aborted.
42474252[ configuration files ] : cli.md#--experimental-config-fileconfig
42484253[ describe options ] : #describename-options-fn
42494254[ it options ] : #testname-options-fn
4255+ [ module customization hooks ] : module.md#customization-hooks
42504256[ running tests from the command line ] : #running-tests-from-the-command-line
42514257[ stream.compose ] : stream.md#streamcomposestreams
42524258[ subtests ] : #subtests
You can’t perform that action at this time.
0 commit comments