Skip to content

Wrong snapshot_accept() suggestion if period in test file name #1669

Open
@moodymudskipper

Description

@moodymudskipper

I have a test file called "test-data.frame.R" (notice there are 2 periods in full name)

When running tests with a new output I get the suggestion to run snapshot_accept("data.frame")

When I run it however I get "No snapshots to update"

This is due to testthat:::snapshot_meta where we find :

files <- ifelse(tools::file_ext(files) == "", paste0(files, ".md"))

There "frame" is returned by tools::file_ext() so no suffix is added.

A solution might be to have :

files <- ifelse(tools::file_ext(files) != "md", paste0(files, ".md")

Another solution would be to manage to have the suggestion be snapshot_accept("data.frame.md")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions