The job of a reporter is to aggregate the results from files, tests, and
expectations and display them in an informative way. Every testtthat function
that runs multiple tests provides a
reporter argument which you can
use to override the default (which is selected by
You only need to use this
Reporter object directly if you are creating
a new reporter. Currently, creating new Reporters is undocumented,
so if you want to create your own, you'll need to make sure that you're
familiar with R6 and then need read the
source code for a few.
#> #> ══ Testing test-success.R ══════════════════════════════════════════════════════ #> [ FAIL 0 | WARN 0 | SKIP 0 | PASS 0 ] [ FAIL 0 | WARN 0 | SKIP 0 | PASS 1 ] [ FAIL 0 | WARN 0 | SKIP 1 | PASS 1 ] [ FAIL 0 | WARN 1 | SKIP 1 | PASS 1 ] [ FAIL 0 | WARN 1 | SKIP 1 | PASS 2 ] [ FAIL 0 | WARN 1 | SKIP 1 | PASS 3 ] [ FAIL 0 | WARN 1 | SKIP 1 | PASS 4 ] #> #> ── Skip (test-success.R:6:3): you can skip tests if needed ───────────────────── #> Reason: This tests hasn't been written yet #> #> ── Warning (test-success.R:10:3): some tests have warnings ───────────────────── #> NaNs produced #> Backtrace: #> 1. testthat::expect_equal(log(-1), NaN) test-success.R:10:2 #> 2. testthat::quasi_label(enquo(object), label, arg = "object") #> 3. rlang::eval_bare(expr, quo_get_env(quo)) #> #> [ FAIL 0 | WARN 1 | SKIP 1 | PASS 4 ]# Override the default by supplying the name of a reporter test_file(path, reporter = "minimal")#> .SW...