-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
doc: cover --experimental-test-module-mocks flag #55021
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 <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs#55021 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs#55021 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: James M Snell <[email protected]>
As I discovered answering this Stack Overflow question,
node:test
'smock.module
is currently hidden behind the--experimental-test-module-mocks
flag. This was covered on the CLI page, but not the test runner page.