Unit Testing for R


[Up] [Top]

Documentation for package ‘testthat’ version 3.2.1.1

Help Pages

announce_snapshot_file Snapshot testing for whole files
auto_test Watches code and tests for changes, rerunning tests as appropriate.
auto_test_package Watches a package for changes, rerunning tests as appropriate.
CheckReporter Check reporter: 13 line summary of problems
CompactProgressReporter Test reporter: interactive progress bar of errors.
compare_file_binary Snapshot testing for whole files
compare_file_text Snapshot testing for whole files
comparison-expectations Does code return a number greater/less than the expected value?
DebugReporter Test reporter: start recovery.
describe describe: a BDD testing language
equality-expectations Does code return the expected value?
expect The building block of all 'expect_' functions
expect_condition Does code throw an error, warning, message, or other condition?
expect_contains Does code return a vector containing the expected values?
expect_equal Does code return the expected value?
expect_error Does code throw an error, warning, message, or other condition?
expect_false Does code return 'TRUE' or 'FALSE'?
expect_gt Does code return a number greater/less than the expected value?
expect_gte Does code return a number greater/less than the expected value?
expect_identical Does code return the expected value?
expect_in Does code return a vector containing the expected values?
expect_invisible Does code return a visible or invisible object?
expect_length Does code return a vector with the specified length?
expect_lt Does code return a number greater/less than the expected value?
expect_lte Does code return a number greater/less than the expected value?
expect_mapequal Does code return a vector containing the expected values?
expect_message Does code throw an error, warning, message, or other condition?
expect_named Does code return a vector with (given) names?
expect_no_condition Does code run without error, warning, message, or other condition?
expect_no_error Does code run without error, warning, message, or other condition?
expect_no_message Does code run without error, warning, message, or other condition?
expect_no_warning Does code run without error, warning, message, or other condition?
expect_output Does code print output to the console?
expect_s3_class Does code return an object inheriting from the expected base type, S3 class, or S4 class?
expect_s4_class Does code return an object inheriting from the expected base type, S3 class, or S4 class?
expect_setequal Does code return a vector containing the expected values?
expect_silent Does code execute silently?
expect_snapshot Snapshot testing
expect_snapshot_file Snapshot testing for whole files
expect_snapshot_value Snapshot testing for values
expect_true Does code return 'TRUE' or 'FALSE'?
expect_type Does code return an object inheriting from the expected base type, S3 class, or S4 class?
expect_vector Does code return a vector with the expected size and/or prototype?
expect_visible Does code return a visible or invisible object?
expect_warning Does code throw an error, warning, message, or other condition?
fail Default expectations that always succeed or fail.
FailReporter Test reporter: fail at end.
inheritance-expectations Does code return an object inheriting from the expected base type, S3 class, or S4 class?
is_checking Determine testing status
is_parallel Determine testing status
is_snapshot Determine testing status
is_testing Determine testing status
it describe: a BDD testing language
JunitReporter Test reporter: summary of errors in jUnit XML format.
ListReporter List reporter: gather all test results along with elapsed time and file information.
local_mocked_bindings Mocking tools
local_reproducible_output Locally set options for maximal test reproducibility
local_test_context Locally set options for maximal test reproducibility
LocationReporter Test reporter: location
logical-expectations Does code return 'TRUE' or 'FALSE'?
MinimalReporter Test reporter: minimal.
MultiReporter Multi reporter: combine several reporters in one.
ParallelProgressReporter Test reporter: interactive progress bar of errors.
ProgressReporter Test reporter: interactive progress bar of errors.
RStudioReporter Test reporter: RStudio
set_state_inspector State inspected
SilentReporter Test reporter: gather all errors silently.
skip Skip a test
skip_if Skip a test
skip_if_not Skip a test
skip_if_not_installed Skip a test
skip_if_offline Skip a test
skip_if_translated Skip a test
skip_on_bioc Skip a test
skip_on_ci Skip a test
skip_on_covr Skip a test
skip_on_cran Skip a test
skip_on_os Skip a test
snapshot_accept Snapshot management
snapshot_review Snapshot management
StopReporter Test reporter: stop on error
succeed Default expectations that always succeed or fail.
SummaryReporter Test reporter: summary of errors.
TapReporter Test reporter: TAP format.
TeamcityReporter Test reporter: Teamcity format.
teardown_env Run code after all test files
testing_package Determine testing status
test_check Run all tests in a package
test_file Run tests in a single file
test_local Run all tests in a package
test_package Run all tests in a package
test_path Locate a file in the testing directory
test_that Run a test
use_catch Use Catch for C++ Unit Testing
with_mocked_bindings Mocking tools