Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# testthat 3.3.1

* `expect_snapshot_file()` correctly reports file name if duplicated (@MichaelChirico, #2296).
* Fixed support for `shinytest2::AppDriver$expect_values()` screenshot snapshot failing on CI (#2293, #2288).

* testthat now emits OpenTelemetry traces for tests when tracing is enabled. Requires the otel and otelsdk packages (#2282).
Expand Down
2 changes: 1 addition & 1 deletion R/snapshot-reporter.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ SnapshotReporter <- R6::R6Class(
save_path <- paste0(c(self$file, variant, name), collapse = "/")
if (save_path %in% self$snap_file_saved) {
cli::cli_abort(
"Snapshot file names must be unique. {.arg name} has already been used.",
"Snapshot file names must be unique. {.val {name}} has already been used.",
call = trace_env
)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/snapshot-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
expect_snapshot_file(write_tmp_lines(r_version()), "version.txt", variant = r_version())
Condition
Error in `expect_snapshot_file()`:
! Snapshot file names must be unique. `name` has already been used.
! Snapshot file names must be unique. "version.txt" has already been used.

# warns on first creation

Expand Down