Skip to content

Commit

Permalink
Remove linebreaks from test descriptions in snapshots; fixes #1900 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
LDSamson authored Oct 29, 2024
1 parent 3628792 commit dd39c65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# testthat (development version)

* `expect_snapshot()` now strips line breaks in test descriptions (@LDSamson, #1900).
* `expect_snapshot()` now errors when called from a `test_that()` that has an empty description (@kevinushey, #1980).
* `skip_if_not_installed()` produces a clearer message (@MichaelChirico, #1959).
* `with_mock()` and `local_mock()` have been unconditionally deprecated as they will no longer work in future versions of R (#1999).
Expand Down
2 changes: 1 addition & 1 deletion R/snapshot-reporter.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SnapshotReporter <- R6::R6Class("SnapshotReporter",
},

start_test = function(context, test) {
self$test <- test
self$test <- gsub("\n", "", test)
},

# Called by expectation
Expand Down

0 comments on commit dd39c65

Please sign in to comment.