docs: update snapshot generation command#8459
Conversation
|
Thanks for merging! The history of https://github.com/npm/cli/commits/latest/CONTRIBUTING.md shows a mixture of commit message usage, so I was a bit confused about which one to align with! After consulting with https://github.com/npm/cli/blob/latest/CONTRIBUTING.md#pull-request-conventions
I checked that |
|
You were right, this should have been a |
Thanks for confirming! It's a minor point and I don't think that is worth trying to correct for this particular PR / commit. However, it is good to have guidance on the right way to handle commits for the |
Situation
In the CONTRIBUTING document, Test Coverage section, the command to update snapshots is inconsistent with the other npm commands in the same document that run
npmthroughnode, and with the introductory comments in that section.To run your repository's version of the npm cli on your local machine use the following commands:
...
To update the snapshots run:
TAP_SNAPSHOT=1 npm testChange
In the CONTRIBUTING document, Test Coverage section, change the command to update snapshots to:
Verification
Ubuntu:
24.04.2LTSNode.js:
22.17.1LTSnpm:
11.15.1Execute the following:
Confirm that there are no errors.
Delete file
tap-snapshots/test/lib/docs.js.test.cjsand execute:and note that the test result is now:
Execute:
Confirm that all tests now pass and that git shows no pending changes (meaning the deleted snapshot file has been fully restored):
References