Man pages for r-lib/testthat
Unit Testing for R

auto_testWatches code and tests for changes, rerunning tests as...
auto_test_packageWatches a package for changes, rerunning tests as...
capture_conditionCapture conditions, including messages, warnings,...
capture_outputCapture output to console
CheckReporterCheck reporter: 13 line summary of problems
compareProvide human-readable comparison of two objects
compare_stateCompare two directory states.
comparison-expectationsDoes code return a number greater/less than the expected...
contextDescribe the context of a set of tests.
context_start_fileStart test context from a file name
DebugReporterTest reporter: start recovery.
default_reporterRetrieve the default reporter
describedescribe: a BDD testing language
dir_stateCapture the state of a directory.
equality-expectationsDoes code return the expected value?
evaluate_promiseEvaluate a promise, capturing all types of output.
expectThe building block of all 'expect_' functions
expectationConstruct an expectation object
expect_equivalentIs an object equal to the expected value, ignoring...
expect_errorDoes code throw an error, warning, message, or other...
expect_invisibleDoes code return a visible or invisible object?
expect_isDoes an object inherit from a given class?
expect_known_outputExpectations: is the output or the value equal to a known...
expect_lengthDoes code return a vector with the specified length?
expect_less_thanDeprecated numeric comparison functions
expect_matchDoes a string match a regular expression?
expect_namedDoes code return a vector with (given) names?
expect_nullDoes code return 'NULL'?
expect_outputDoes code print output to the console?
expect_output_fileExpectations: is the output or the value equal to a known...
expect_referenceDoes code return a reference to the expected object?
expect_setequalDoes code return a vector containing the expected values?
expect_silentDoes code execute silently?
expect_snapshotSnapshot testing
expect_snapshot_fileSnapshot testing for whole files
expect_successTools for testing expectations
expect_thatExpect that a condition holds.
expect_vectorDoes code return a vector with the expected size and/or...
failDefault expectations that always succeed or fail.
FailReporterTest reporter: fail at end.
find_reporterFind reporter object given name or object.
find_test_scriptsFind test files
inheritance-expectationsDoes code return an object inheriting from the expected base...
is_informative_errorIs an error informative?
is_testingDetermine testing status
JunitReporterTest reporter: summary of errors in jUnit XML format.
ListReporterList reporter: gather all test results along with elapsed...
local_editionTemporarily change the active testthat edition
local_snapshotterInstantiate local snapshotting context
local_test_contextLocally set options for maximal test reproducibility
local_test_directoryLocally set test directory options
LocationReporterTest reporter: location
logical-expectationsDoes code return 'TRUE' or 'FALSE'?
make_expectationMake an equality test.
MinimalReporterTest reporter: minimal.
MultiReporterMulti reporter: combine several reporters in one.
notNegate an expectation
oldskoolOld-style expectations.
ProgressReporterTest reporter: interactive progress bar of errors.
quasi_labelQuasi-labelling
reexportsObjects exported from other packages
ReporterManage test reporting
reporter-accessorsGet and set active reporter.
RStudioReporterTest reporter: RStudio
run_cpp_testsDo C++ tests past?
safe_digestCompute a digest of a filename, returning NA if the file...
SilentReporterTest reporter: gather all errors silently.
skipSkip a test
snapshot_acceptSnapshot management
source_fileSource a file, directory of files, or various important...
StopReporterTest reporter: stop on error
SummaryReporterTest reporter: summary of errors.
takes_less_thanDoes code take less than the expected amount of time to run?
TapReporterTest reporter: TAP format.
TeamcityReporterTest reporter: Teamcity format.
teardownRun code before/after tests
teardown_envRun code after all test files
test_dirRun all tests in a directory
test_envGenerate default testing environment.
test_examplesTest package examples
test_fileRun all tests in a single file
test_packageRun all tests in a package
test_pathLocate file in testing directory.
test_thatRun a test
testthat_examplesRetrieve paths to built-in example test files
testthat-packageAn R package to make testing fun!
testthat_resultsCreate a 'testthat_results' object from the test results as...
try_againTry evaluating an expressing multiple times until it...
use_catchUse Catch for C++ Unit Testing
verify_outputVerify output
watchWatch a directory for changes (additions, deletions &...
with_mockMock functions in a package.
r-lib/testthat documentation built on Sept. 25, 2021, 3:02 p.m.