Skip to content

Commit 8c8ee0a

Browse files
committed
Update test to use snapshot
1 parent 8fb7aec commit 8c8ee0a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

tests/testthat/_snaps/watch.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# watcher() error handling
2+
3+
Code
4+
watcher(latency = -1)
5+
Condition
6+
Error in `initialize()`:
7+
! Watcher latency cannot be negative.
8+

tests/testthat/test-watch.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ unlink(dir, recursive = TRUE, force = TRUE)
8080
unlink(dir2, recursive = TRUE, force = TRUE)
8181

8282
test_that("watcher() error handling", {
83-
expect_error(watcher(latency = -1), "Watcher latency cannot be negative.")
83+
expect_snapshot(watcher(latency = -1), error = TRUE)
8484
})
8585

8686
Sys.sleep(1) # time for watch threads to terminate and release resources

0 commit comments

Comments
 (0)