tests/testthat/_snaps/source.md

source_file wraps error

Code
  source_file(test_path("reporters/error-setup.R"), wrap = FALSE)
Condition
  Error:
  ! In path: "reporters/error-setup.R"
  Caused by error in `h()`:
  ! !

can find only matching test

Code
  filter_desc(code, "baz")
Condition
  Error:
  ! Failed to find test with specified description

preserve srcrefs

Code
  filter_desc(code, "foo")
Output
  expression(test_that("foo", {
        # this is a comment
      }))

errors if duplicate labels

Code
  filter_desc(code, "baz")
Condition
  Error:
  ! Found multiple tests with specified description


Try the testthat package in your browser

Any scripts or data that you put into this service are public.

testthat documentation built on May 29, 2024, 9:38 a.m.