Skip to content

Snapshot testing bug (?): "no snapshotter active" #1226

@raphael-lorenzdelaigue

Description

@raphael-lorenzdelaigue

I created a new custom package following the guidelines here: https://r-pkgs.org/whole-game.html
And tried to perform snapshot testing on a function following this vignette: https://testthat.r-lib.org/articles/snapshotting.html.
However when trying to run the test I get the following message

No snapshotter active. Current value: 
[...]

The current value makes sense for my function, but the _snaps folder and corresponding *.R file are not created. I get the same message if re-running the test.

Same thing if I try with another function, for example the "bullets" example function from the vignette.

Example code:

test_that("bullets", {
  local_edition(3)
  expect_snapshot(cat(bullets("a")))
})

Example output:

No snapshotter active. Current value: 
Code
    cat(bullets(\"a\"))
Output
  <ul>
      <li>a</li>
  </ul>
-- Skip (???): bullets---------------------------------------------------------
Reason: empty test

Is there a way to activate the snapshotter? Or is this just a bug?

I am quite new to R/RStudio so I might have missed out on something obvious to try out. Happy for any kind of advice.

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