Skip to content

Commit c885313

Browse files
authored
Merge branch 'main' into feature/add-recursive-dirs
2 parents da5911b + 24ff6c0 commit c885313

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# testthat (development version)
22

33
* `test_dir()` gains a `recursive` argument which allows test files in nested directories (#1605).
4+
* Fixed an issue where calling `skip()` outside of an active test could
5+
cause an unexpected error (@kevinushey, #2039).
46

57
# testthat 3.2.2
68

R/snapshot-reporter.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ SnapshotReporter <- R6::R6Class("SnapshotReporter",
3535
},
3636

3737
start_test = function(context, test) {
38-
self$test <- gsub("\n", "", test)
38+
if (is.character(test)) {
39+
self$test <- gsub("\n", "", test)
40+
}
3941
},
4042

4143
# Called by expectation

0 commit comments

Comments
 (0)