File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2508,6 +2508,11 @@ Node.js builtin modules. Any references to the original module prior to mocking
25082508order to enable module mocking, Node.js must be started with the
25092509[ ` --experimental-test-module-mocks ` ] [ ] command-line flag.
25102510
2511+ ** Note** : [ module customization hooks] [ ] registered via the ** synchronous** API effect resolution of
2512+ the ` specifier ` provided to ` mock.module ` . Customization hooks registered via the ** asynchronous**
2513+ API are currently ignored (because the test runner's loader is synchronous, and node does not
2514+ support multi-chain / cross-chain loading).
2515+
25112516The following example demonstrates how a mock is created for a module.
25122517
25132518``` js
@@ -4255,6 +4260,7 @@ Can be used to abort test subtasks when the test has been aborted.
42554260[ configuration files ] : cli.md#--experimental-config-fileconfig
42564261[ describe options ] : #describename-options-fn
42574262[ it options ] : #testname-options-fn
4263+ [ module customization hooks ] : module.md#customization-hooks
42584264[ running tests from the command line ] : #running-tests-from-the-command-line
42594265[ stream.compose ] : stream.md#streamcomposestreams
42604266[ subtests ] : #subtests
You can’t perform that action at this time.
0 commit comments