11test_that(" can establish local snapshotter for testing" , {
2- snapper <- local_snapshotter( fail_on_new = FALSE )
2+ snapper <- local_test_snapshotter( )
33
44 snapper $ start_file(" snapshot-1" , " test" )
55 expect_true(snapper $ is_active())
@@ -9,7 +9,7 @@ test_that("can establish local snapshotter for testing", {
99
1010test_that(" basic workflow" , {
1111 path <- withr :: local_tempdir()
12- snapper <- local_snapshotter( path , fail_on_new = FALSE )
12+ snapper <- local_test_snapshotter( snap_dir = path )
1313 snapper $ start_file(" snapshot-2" )
1414 # output if not active (because test not set here)
1515 expect_snapshot_output(" x" ) | >
@@ -42,15 +42,15 @@ test_that("defaults to failing on CI", {
4242 withr :: local_envvar(CI = " true" )
4343
4444 path <- withr :: local_tempdir()
45- snapper <- local_snapshotter(path )
45+ snapper <- local_snapshotter(snap_dir = path )
4646 snapper $ start_file(" snapshot-2" )
4747 # warns on first creation
4848 snapper $ start_file(" snapshot-2" , " test" )
4949 expect_error(expect_snapshot_output(" x" ), " Adding new" )
5050})
5151
5252test_that(" only create new files for changed variants" , {
53- snapper <- local_snapshotter( fail_on_new = FALSE )
53+ snapper <- local_test_snapshotter( )
5454 snapper $ start_file(" variants" , " test" )
5555 expect_warning(expect_snapshot_output(" x" ), " Adding new" )
5656 expect_warning(expect_snapshot_output(" x" , variant = " a" ), " Adding new" )
@@ -86,7 +86,7 @@ test_that("only create new files for changed variants", {
8686})
8787
8888test_that(" only reverting change in variant deletes .new" , {
89- snapper <- local_snapshotter( fail_on_new = FALSE )
89+ snapper <- local_test_snapshotter( )
9090 snapper $ start_file(" v" , " test" )
9191 expect_warning(expect_snapshot_output(" x" , variant = " a" ), " Adding new" )
9292 expect_warning(expect_snapshot_output(" x" , variant = " b" ), " Adding new" )
@@ -109,7 +109,7 @@ test_that("only reverting change in variant deletes .new", {
109109
110110test_that(" removing tests removes snap file" , {
111111 path <- withr :: local_tempdir()
112- snapper <- local_snapshotter( path , fail_on_new = FALSE )
112+ snapper <- local_test_snapshotter( snap_dir = path )
113113 snapper $ start_file(" snapshot-3" , " test" )
114114 expect_warning(expect_snapshot_output(" x" ), " Adding new" )
115115 snapper $ end_file()
@@ -121,7 +121,7 @@ test_that("removing tests removes snap file", {
121121})
122122
123123test_that(" errors in test doesn't change snapshot" , {
124- snapper <- local_snapshotter( fail_on_new = FALSE )
124+ snapper <- local_test_snapshotter( )
125125
126126 # First run
127127 snapper $ start_file(" snapshot-5" , " test" )
0 commit comments