| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2497,6 +2497,11 @@ Node.js builtin modules. Any references to the original module prior to mocking | |||
| 2497 | 2497 | order to enable module mocking, Node.js must be started with the | |
| 2498 | 2498 | [`--experimental-test-module-mocks`][] command-line flag. | |
| 2499 | 2499 | ||
| 2500 | + **Note**: [module customization hooks][] registered via the **synchronous** API effect resolution of | ||
| 2501 | + the `specifier` provided to `mock.module`. Customization hooks registered via the **asynchronous** | ||
| 2502 | + API are currently ignored (because the test runner's loader is synchronous, and node does not | ||
| 2503 | + support multi-chain / cross-chain loading). | ||
| 2504 | + | ||
| 2500 | 2505 | The following example demonstrates how a mock is created for a module. | |
| 2501 | 2506 | ||
| 2502 | 2507 | ```js | |
@@ -4244,6 +4249,7 @@ Can be used to abort test subtasks when the test has been aborted. | |||
| 4244 | 4249 | [configuration files]: cli.md#--experimental-config-fileconfig | |
| 4245 | 4250 | [describe options]: #describename-options-fn | |
| 4246 | 4251 | [it options]: #testname-options-fn | |
| 4252 | + [module customization hooks]: module.md#customization-hooks | ||
| 4247 | 4253 | [running tests from the command line]: #running-tests-from-the-command-line | |
| 4248 | 4254 | [stream.compose]: stream.md#streamcomposestreams | |
| 4249 | 4255 | [subtests]: #subtests | |
| Back | FazBrowse Home | New Git URL |
0 commit comments