Unit Testing for R


[Up] [Top]

Documentation for package ‘testthat’ version 0.11.0

Help Pages

testthat-package R package to make testing fun!
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
CheckReporter-class Check reporter: 13 line summary of problems
compare Provide human-readable comparison of two objects
compare.character Provide human-readable comparison of two objects
compare.default Provide human-readable comparison of two objects
compare.numeric Provide human-readable comparison of two objects
context Describe the context of a set of tests.
describe describe: a BDD testing language
equivalence Expectation: is the object equal to a value?
evaluate_promise Evaluate a promise, capturing all types of output.
expect-compare Expectation: is returned value less or greater than specified value?
expect_equal Expectation: is the object equal to a value?
expect_equal_to_reference Expectation: is the object equal to a reference value stored in a file?
expect_equivalent Expectation: is the object equal to a value?
expect_error Expectation: does string/output/message/warning/error match a regular expression?
expect_false Expectation: is the object true/false?
expect_gt Expectation: is returned value less or greater than specified value?
expect_gte Expectation: is returned value less or greater than specified value?
expect_identical Expectation: is the object equal to a value?
expect_is Expectation: does the object inherit from a class?
expect_less_than Expectation: is returned value less or greater than specified value?
expect_lt Expectation: is returned value less or greater than specified value?
expect_lte Expectation: is returned value less or greater than specified value?
expect_match Expectation: does string/output/message/warning/error match a regular expression?
expect_message Expectation: does string/output/message/warning/error match a regular expression?
expect_more_than Expectation: is returned value less or greater than specified value?
expect_named Expectation: does object have names?
expect_null Expectation: is the object NULL?
expect_output Expectation: does string/output/message/warning/error match a regular expression?
expect_silent Expect that code has no output, messages, or warnings.
expect_true Expectation: is the object true/false?
expect_warning Expectation: does string/output/message/warning/error match a regular expression?
fail A default expectation that always fails.
ListReporter List reporter: gather all test results along with elapsed time and file information.
ListReporter-class List reporter: gather all test results along with elapsed time and file information.
make_expectation Make an equality test.
matching-expectations Expectation: does string/output/message/warning/error match a regular expression?
MinimalReporter Test reporter: minimal.
MinimalReporter-class Test reporter: minimal.
MultiReporter Multi reporter: combine several reporters in one.
MultiReporter-class Multi reporter: combine several reporters in one.
Reporter Stub object for managing a reporter of tests.
Reporter-class Stub object for managing a reporter of tests.
RstudioReporter Test reporter: RStudio
RstudioReporter-class Test reporter: RStudio
setup_test_dir Take care or finding the test files and sourcing the helpers.
SilentReporter Test reporter: gather all errors silently.
SilentReporter-class Test reporter: gather all errors silently.
skip Skip a test.
skip_if_not_installed Skip a test.
skip_on_appveyor Skip a test.
skip_on_cran Skip a test.
skip_on_os Skip a test.
skip_on_travis Skip a test.
StopReporter Test reporter: stop on error.
StopReporter-class Test reporter: stop on error.
succeed A default expectation that always succeeds.
SummaryReporter Test reporter: summary of errors.
SummaryReporter-class Test reporter: summary of errors.
TapReporter Test reporter: TAP format.
TapReporter-class Test reporter: TAP format.
TeamcityReporter Test reporter: Teamcity format.
TeamcityReporter-class Test reporter: Teamcity format.
testthat R package to make testing fun!
testthat_results Create a 'testthat_results' object from the test results as stored in the ListReporter results field.
test_check Run all tests in an installed package.
test_dir Run all of the tests in a directory.
test_example Test package examples
test_examples Test package examples
test_file Run all tests in specified file.
test_package Run all tests in an installed package.
test_that Create a test.
watch Watch a directory for changes (additions, deletions & modifications).
with_mock Mock functions in a package.