I have a test for which if the prerequisites are not met (e.g., missing file or something) I would like to make it fail.
Just for clarification, here’s an example I’d like to do:
test_that("...", {
if ( ... precondition to execute the test is not met... ) {
expect_true(FALSE) # Make it fail without going further
}
expect_that( ... real test here ...)
})
Now my question is: Is there any fail()-like expectation in the testthat package or I have to write expect_true(FALSE) all the time?
There isn’t a
failfunction intestthatat the moment. I think you want something likeUsage is, for example,