Skip to content

Add -u as the short form of --snapshot-update #1293

Description

@Chemaclass

🤔 Background

--snapshot-update is the flag you reach for the moment a deliberate output change turns a snapshot red, so it gets retyped more than most. It has no short form.

Both frameworks that own snapshot-testing muscle memory spell it the same way:

  • jest — -u, --updateSnapshot
  • vitest — -u, --update

Anyone arriving from either types -u first. Today that is an unknown option, so the run fails rather than doing what was meant.

-u is unclaimed: the short options in use are -a -e -f -h -j -l -p -r -R -s -S -vvv -w.

💡 Proposal

Accept -u as an alias for --snapshot-update. The long form stays; this is only the spelling that does not have to be looked up. Same reasoning as --pass-with-no-tests, adopted from jest and vitest by name rather than invented.

Touches the parse arm, both completion scripts (their parity test enforces it), the help text and the docs.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions