You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't yet figured out how to test snapshots with snapshots, so you can run this to test interactively
```R
test_that("expect_snapshot_file() show differences for text files", {
path1 <- withr::local_tempfile(lines = sample(letters[1:10]))
expect_snapshot_file(path1, "text-diff.txt")
})
```
Fixes#1593
Copy file name to clipboardExpand all lines: NEWS.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# testthat (development version)
2
2
3
+
*`expect_snapshot_file()` now considers `.json` to be a text file (#1593).
4
+
*`expect_snapshot_file()` now shows differences for text files (#1593).
3
5
*`expect_snapshot_file(name=)` must have a unique file path. If a snapshot file attempts to be saved with a duplicate `name`, an error will be thrown. (#1592)
4
6
*`test_dir()`, `test_file()`, `test_package()`, `test_check()`, `test_local()`, `source_file()` gain a `shuffle` argument uses `sample()` to randomly reorder the top-level expressions in each test file (#1942). This random reordering surfaces dependencies between tests and code outside of any test, as well as dependencies between tests. This helps you find and eliminate unintentional dependencies.
5
7
*`snapshot_accept(test)` now works when the test file name contains `.` (#1669).
0 commit comments