Rdocumentation
powered by
Learn R Programming
⚠️
There's a newer version (3.2.3) of this package.
Take me there.
testthat (version 1.0.0)
Unit Testing for R
Description
A unit testing system designed to be fun, flexible and easy to set up.
Copy Link
Link to current version
Version
Version
3.2.3
3.2.2
3.2.1.1
3.2.1
3.2.0
3.1.10
3.1.9
3.1.8
3.1.7
3.1.6
3.1.5
3.1.4
3.1.3
3.1.2
3.1.1
3.1.0
3.0.4
3.0.3
3.0.2
3.0.1
3.0.0
2.3.2
2.3.1
2.3.0
2.2.1
2.2.0
2.1.1
2.1.0
2.0.1
2.0.0
1.0.2
1.0.1
1.0.0
0.11.0
0.10.0
0.9.1
0.8.1
0.7.1
0.6
0.5
0.4
0.3
0.2
0.1.1
Install
install.packages('testthat')
Monthly Downloads
397,049
Version
1.0.0
License
MIT + file LICENSE
Issues
104
Pull Requests
27
Stars
902
Forks
332
Repository
https://github.com/hadley/testthat
Maintainer
Hadley Wickham
Last Published
April 14th, 2016
Functions in testthat (1.0.0)
Search all functions
expect_equal_to_reference
Expectation: is the object equal to a reference value stored in a file?
dir_state
Capture the state of a directory.
compare_state
Compare two directory states.
SilentReporter
Test reporter: gather all errors silently.
RstudioReporter
Test reporter: RStudio
expectation
Expectation class.
use_catch
Use Catch for C++ Unit Testing
context
Describe the context of a set of tests.
equality-expectations
Expectation: is the object equal to a value?
fail
Default expectations that alway succeed or fail.
evaluate_promise
Evaluate a promise, capturing all types of output.
watch
Watch a directory for changes (additions, deletions & modifications).
safe_digest
Compute a digest of a filename, returning NA if the file doesn't exist.
logical-expectations
Expectation: is the object true/false?
expect_that
Expect that a condition holds.
find_test_scripts
Find the test files.
reexports
Objects exported from other packages
test_that
Create a test.
output-expectations
Expectation: does code produce output/message/warning/error?
Reporter
Stub object for managing a reporter of tests.
find_reporter
Find reporter object given name or object.
auto_test_package
Watches a package for changes, rerunning tests as appropriate.
test_package
Run all tests in an installed package.
MinimalReporter
Test reporter: minimal.
inheritance-expectations
Expectation: does the object inherit from a S3 or S4 class, or a base type?
StopReporter
Test reporter: stop on error.
ListReporter
List reporter: gather all test results along with elapsed time and file information.
TapReporter
Test reporter: TAP format.
with_mock
Mock functions in a package.
describe
describe: a BDD testing language
oldskool
Old-style expectations.
expect_match
Expectation: does string/output/message/warning/error match a regular expression?
takes_less_than
Expectation: does expression take less than a fixed amount of time to run?
source_file
Source a file, directory, or all helpers.
CheckReporter
Check reporter: 13 line summary of problems
test_dir
Run all of the tests in a directory.
SummaryReporter
Test reporter: summary of errors.
expect_cpp_tests_pass
Test Compiled Code in a Package
compare
Provide human-readable comparison of two objects
expect_length
Expectation: does a vector have the specified length?
test_file
Run all tests in specified file.
testthat_results
Create a `testthat_results` object from the test results as stored in the ListReporter results field.
reporter-accessors
Get/set reporter; execute code in specified reporter.
skip
Skip a test.
test_examples
Test package examples
not
Negate an expectation
testthat
R package to make testing fun!
auto_test
Watches code and tests for changes, rerunning tests as appropriate.
make_expectation
Make an equality test.
expect_success
Tools for testing expectations
FailReporter
Test reporter: fail at end.
test_env
Generate default testing environment.
MultiReporter
Multi reporter: combine several reporters in one.
TeamcityReporter
Test reporter: Teamcity format.
comparison-expectations
Expectation: is returned value less or greater than specified value?
test_path
Locate file in testing directory.
expect_named
Expectation: does object have names?
try_again
Try evaluating an expressing multiple times until it succeeds.