Skip to content

Consider not updating snapshots automatically #2099

Open
@novemberborn

Description

@novemberborn

It may be considered odd that AVA automatically updates snapshots. From @billyjanitsch #1585 (comment):

I've never liked the behavior of auto-creating new snapshots without -u: I imagine most users think of running ava as a pure function which returns a boolean describing whether their tests passed or failed. So it's odd for ava to have side effects by default, especially those which modify VCS-tracked files.

Then from @novemberborn #1585 (comment):

what if we'd write snapshot updates to a temporary location, exit with an instructive failure and exit code of 1, and then have a npx ava --commit-snapshots command (pending bike-shedding) to write them into [the] source tree?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions