File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2222,6 +2222,11 @@ Node.js builtin modules. Any references to the original module prior to mocking
22222222order to enable module mocking, Node.js must be started with the
22232223[ ` --experimental-test-module-mocks ` ] [ ] command-line flag.
22242224
2225+ ** Note** : [ module customization hooks] [ ] registered via the ** synchronous** API effect resolution of
2226+ the ` specifier ` provided to ` mock.module ` . Customization hooks registered via the ** asynchronous**
2227+ API are currently ignored (because the test runner's loader is synchronous, and node does not
2228+ support multi-chain / cross-chain loading).
2229+
22252230The following example demonstrates how a mock is created for a module.
22262231
22272232``` js
@@ -3886,6 +3891,7 @@ Can be used to abort test subtasks when the test has been aborted.
38863891[ code coverage ] : #collecting-code-coverage
38873892[ describe options ] : #describename-options-fn
38883893[ it options ] : #testname-options-fn
3894+ [ module customization hooks ] : module.md#customization-hooks
38893895[ running tests from the command line ] : #running-tests-from-the-command-line
38903896[ stream.compose ] : stream.md#streamcomposestreams
38913897[ subtests ] : #subtests
You can’t perform that action at this time.
0 commit comments