Skip to content

Commit 9cbfbe8

Browse files
authored
Merge pull request #3 from rasmusab/fix-print-method
Add a print method to the ProjectReporter class
2 parents e2cd779 + 8f44994 commit 9cbfbe8

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

R/reporter-project.R

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,21 @@ ProjectReporter <- R6::R6Class("ProjectReporter", inherit = testthat::ListReport
5757
message = message,
5858
success = success,
5959
outcome = outcome)
60+
},
61+
print = function() {
62+
end_report <- self$end_reporter()
63+
summary <- end_report$summary
64+
tests <- end_report$tests
65+
cat((summary$tests - summary$failures - summary$errors), "/", summary$tests, " tests passed",sep = "")
66+
cat("\n")
67+
for(i in seq_along(tests)) {
68+
test <- tests[[i]]
69+
if(test$success) next
70+
cat(">", test$outcome, "::", test$name)
71+
cat("\n")
72+
cat( test$message, "\n---\n")
73+
}
74+
invisible(self)
6075
}
6176
),
6277
private = list(

0 commit comments

Comments
 (0)