Learn R Programming

⚠️There's a newer version (3.2.3) of this package.Take me there.

testthat (version 0.9.1)

Testthat code. Tools to make testing fun :)

Description

A testing package specifically tailored for R that's fun, flexible and easy to set up.

Copy Link

Version

Install

install.packages('testthat')

Monthly Downloads

578,511

Version

0.9.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Hadley Wickham

Last Published

October 1st, 2014

Functions in testthat (0.9.1)

StopReporter-class

Test reporter: stop on error.
auto_test

Watches code and tests for changes, rerunning tests as appropriate.
TapReporter-class

Test reporter: TAP format.
ListReporter-class

List reporter: gather all test results along with elapsed time and file information.
auto_test_package

Watches a package for changes, rerunning tests as appropriate.
MultiReporter-class

Multi reporter: combine several reporters in one.
compare_state

Compare two directory states.
test_package

Run all tests in an installed package
gives_warning

Expectation: does expression give a warning?
is_null

Expectation: is the object NULL?
is_a

Expectation: does the object inherit from a class?
test_that

Create a test.
safe_digest

Compute a digest of a filename, returning NA if the file doesn't exist.
equals

Expectation: is the object equal (with numerical tolerance) to a value?
expectation

Expectation class.
SilentReporter-class

Test reporter: gather all errors silently.
context

Describe the context of a set of tests.
find_reporter

Find reporter object given name
shows_message

Expectation: does expression show a message?
throws_error

Expectation: does expression throw an error?
reporter-accessors

Get/set reporter; execute code in specified reporter.
prints_text

Expectation: does printed output match a regular expression?
evaluate_promise

Evaluate a promise, capturing all types of output.
with_mock

Mock functions in a package.
watch

Watch a directory for changes (additions, deletions & modifications).
MinimalReporter-class

Test reporter: minimal.
SummaryReporter-class

Test reporter: summary of errors.
dir_state

Capture the state of a directory.
source_dir

Load all source files in a directory.
is_identical_to

Expectation: is the object identical to another?
is_true

Expectation: is the object true/false?
fail

A default expectation that always fails.
describe

describe: a BDD testing language
test_env

Generate default testing environment.
library_if_available

Load package, if available.
TeamcityReporter-class

Test reporter: Teamcity format.
testthat

R package to make testing fun!
make_expectation

Make an equality test.
matches

Expectation: does string match regular expression?
takes_less_than

Expectation: does expression take less than a fixed amount of time to run?
is_equivalent_to

Expectation: is the object equivalent to a value? This expectation tests for equivalency: are two objects equal once their attributes have been removed.
has_names

Expectation: does object have names?
not

Negate an expectation
colourise

Colourise text for display in the terminal.
test_file

Run all tests in specified file.
expect_that

Expect that a condition holds.
skip

Skip a test.
expect-compare

Expectation: is returned value less or greater than specified value?
test_dir

Run all of the tests in a directory.
Reporter-class

Stub object for managing a reporter of tests.
equals_reference

Expectation: is the object equal to a reference value stored in a file?