Skip to content

Commit e2cd779

Browse files
committed
skip test after first expectation fails
1 parent dd34a52 commit e2cd779

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: IRkernel.testthat
22
Title: What the Package Does (one line, title case)
3-
Version: 0.0.2
3+
Version: 0.1.0
44
Authors@R: person("Michael", "Chow", email = "michael@datacamp.com", role = c("aut", "cre"))
55
Description: Implements reporter for communicating testthat results to a jupyter client.
66
License: All Rights Reserved

R/reporter-project.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ ProjectReporter <- R6::R6Class("ProjectReporter", inherit = testthat::ListReport
1111
super$initialize(...)
1212
self$all_tests = testthat:::Stack$new()
1313
},
14+
add_result = function(context, test, result) {
15+
super$add_result(context, test, result)
16+
if (!testthat:::expectation_ok(result)) {
17+
testthat::skip("")
18+
}
19+
},
1420
end_reporter = function() {
1521
test_res <- lapply(self$results$as_list(),
1622
self$dump_test)
@@ -49,7 +55,7 @@ ProjectReporter <- R6::R6Class("ProjectReporter", inherit = testthat::ListReport
4955

5056
list(name = test$test,
5157
message = message,
52-
success = !any(res$failed, res$error),
58+
success = success,
5359
outcome = outcome)
5460
}
5561
),

0 commit comments

Comments
 (0)