-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
doc: cover --experimental-test-module-mocks flag #55021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Review requested:
|
| prior to mocking are not impacted. In order to enable module mocking, Node.js must | ||
| be started with the [`--experimental-test-module-mocks`][] command-line flag. | ||
|
|
||
| The following example demonstrates how a mock is created for a module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC any conditions for this belong in the stability blockquote
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to make this consistent (within the test docs page, at least); other examples using experimental flags, neither of which does so in the blockquote:
- https://nodejs.org/api/test.html#snapshot-testing (I based the sentence I added on this); and
- https://nodejs.org/api/test.html#collecting-code-coverage
|
Landed in 5e25c2a |
PR-URL: #55021 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#55021 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#55021 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: James M Snell <jasnell@gmail.com>
As I discovered answering this Stack Overflow question,
node:test'smock.moduleis currently hidden behind the--experimental-test-module-mocksflag. This was covered on the CLI page, but not the test runner page.