Skip to content

feat: Disable new snapshot error #2320

@schloerke

Description

@schloerke

#2149 added new feature:


This is problematic for packages with many snapshots.

Situation:

  • Package has many visual snapshot tests
  • Many snaps cause package to be larger than 5mb
  • These snaps a never used within revdep checks

Previous solution:

  • R build Ignore the tests/testthat/_snaps folder. Nothing is sent to CRAN and nothing is tested on CI. Local testing performs full snapshot testing.

Proposal:

  • The default value of fail_on_new should be determined by the existence of the _snaps folder: fail_on_new = fs::dir_exists(here::here("tests/testthat/_snaps"))
    • Behavior:
      • If no snaps exist during testing, do not fail on new snaps (new behavior)
      • else fail then any new snap should cause a CI failure (current behavior)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions