Skip to content

docs: add test snapshot #8435

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

Merged
merged 2 commits into from
Jul 15, 2025
Merged

docs: add test snapshot #8435

merged 2 commits into from
Jul 15, 2025

Conversation

reggi
Copy link
Contributor

@reggi reggi commented Jul 15, 2025

No description provided.

@reggi reggi requested a review from a team as a code owner July 15, 2025 17:16
@reggi reggi changed the title docs: add test snapshot doc: add test snapshot Jul 15, 2025
wraithgar
wraithgar previously approved these changes Jul 15, 2025
@reggi reggi changed the title doc: add test snapshot docs: add test snapshot Jul 15, 2025
@reggi reggi changed the title docs: add test snapshot docs: add test snapshot Jul 15, 2025
Co-authored-by: Gar <gar+gh@danger.computer>
@reggi reggi merged commit ef3529e into latest Jul 15, 2025
20 checks passed
@reggi reggi deleted the reggi-patch-2 branch July 15, 2025 19:40
@github-actions github-actions bot mentioned this pull request Jul 15, 2025
@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Jul 16, 2025

Shouldn't this be

TAP_SNAPSHOT=1 node . run test

or is it OK to run just the following as in this PR (which would run the installed npm version, not npm from the repo's current branch):

TAP_SNAPSHOT=1 npm test

??

I had also suggested

node . run test -- --snapshot

but there was no discussion about using that.

Unfortunately this PR was submitted and merged outside of my working hours, so I had no chance to comment whilst it was still open.

@wraithgar
Copy link
Member

Yes it's technically more correct to do node . in this repo, but for generating snapshots I don't know if it's mission critical. Our node . suggestion in the other examples is a "best practice" suggestion that is mostly about catching bugs when dealing with the run-script code itself. In the snapshot context it's not going to affect things that much, those won't alter based on how the tests are invoked.

If you suggested a PR that changed this it would still be accepted. We really do appreciate the improvements you have been suggesting to all of the docs and processes that are easy to overlook. Thank you.

@wraithgar
Copy link
Member

As far as --snapshot vs TAP_SNAPSHOT=1 I know that the latter is what we use ourselves locally. All other things being equal it's less likely to be mis-copied (if someone were to try to manually re-type it) cause that -- is easy to miss. Not a big distinction (and probably not a consequential one) but that's usually why we do it that way.

@MikeMcC399
Copy link
Contributor

@wraithgar

Thanks for your comments, your explanations and your encouragement!

For practical purposes it should be fine to leave it as it is for this release. I'll revisit it for the next release in terms of consistency in the CONTRIBUTING document regarding how to call npm test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants