前提条件が満たされていない場合(ファイルの欠落など)、失敗させたいテストがあります。
明確にするために、これが私がやりたい例です:
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 ...)
})
今私の質問は次のとおりです:testthatパッケージに何かfail()
のような期待がありますか、それとも私はいつも書く必要がありますか?expect_true(FALSE)