Skip to content

testthat

3.3.2

Unit Testing for R

133packages dependsuggested by 12,603
11.3Mdownloads / year
84.8%test coverage
13/13flavors OK

Overview

About

Software testing is important, but, in part because it is frustrating and boring, many of us avoid it. 'testthat' is a testing framework for R that is easy to learn and use, and integrates with your existing 'workflow'.

Changes in 3.3.2
  • testthat now emits OpenTelemetry traces for tests when tracing is enabled. Requires the otel and otelsdk packages (#2282).
  • default_parallel_reporter() is no longer exported; use default_reporter(parallel = TRUE) instead (#2305).
  • expect_snapshot() once again reports the original error class for base errors, rather than rlang_error (#2286).
  • expect_snapshot_file() once again works with shinytest2 on CI (#2293, #2288).
  • expect_snapshot_file() correctly reports file name if duplicated (@MichaelChirico, #2296).
  • expect_success() and expect_failure() now always report the observed number of successes and failures (#2297).
  • LlmReporter() is a new reporter designed for use by LLM coding agents. It's used automatically inside Claude Code, Cursor, and Gemini CLI, and you can set AGENT=1 to use with any coding agent (#2287).
  • local_mocked_s3_method() and local_mocked_s4_method() can now mock methods that don't already exist, and can use definition = NULL to temporarily remove a method. local_mocked_s4_method() now also works when the generic is defined in another package (#2302).
  • local_snapshotter() restores snap_dir to be the first argument for compatibility with devtools 2.4.6 (#2309).
  • test_dir() no longer runs tests in parallel if only a single file is being tested (#2305).

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 6.3 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-10-17
  • WARNING12 OK, 1 WARNING2026-10-01
  • OK13 OK2026-09-01
  • ERROR12 OK, 1 ERROR2026-08-25
  • OK13 OK2026-08-21
Show 16 earlier changesHide 16 earlier changes
  • WARNING12 OK, 1 WARNING2026-08-20
  • ERROR12 OK, 1 ERROR2026-08-12
  • OK13 OK2026-08-04
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-07-13
  • ERROR12 OK, 1 ERROR2026-07-11
  • OK13 OK2026-05-30
  • ERROR12 OK, 1 ERROR2026-05-28
  • OK13 OK2026-05-05
  • ERROR12 OK, 1 ERROR2026-05-04
  • OK12 OK2026-04-25
  • NOTE12 OK, 2 NOTE2026-04-20
  • ERROR11 OK, 2 NOTE, 1 ERROR2026-04-18
  • NOTE12 OK, 2 NOTE2026-04-15
  • ERROR11 OK, 2 NOTE, 1 ERROR2026-04-12
  • NOTE12 OK, 2 NOTE2026-03-10
Advisories

none known

Documentation

In release 3.3.2
READMEYes · 286 wordsVignettesYes · 9 · dynamicNEWSYes · 100% structured · mentions 3.3.2Citation fileYes · cites a publicationWebsiteYes · pkgdown
Help pages
109 (51 internal)includes a package overview page
Examples that run
95%39 run in a plain check (1 of them under a condition) · 2 never run
Exported functions with examples
39%
Documented parameters
80%
Return-value docs
18%
Help pages citing references
0%

Downloads

11.3M
CRAN downloads in the past year
Rank #72 · ~30.9K/day · ~940.3K/mo
Daily download trend is not available in this view yet.
737.3K30 days
2.6M90 days
11.3M1 year
Compare downloads with other packages →
Also on188.4K r2u151 autocran404.5K conda_forge281 bioconda5.2K c2d4u

Repository

942Stars
348Forks
25Open issues
10Open PRs
41Releases
2,635Commits
148Commit identities
runit-testing
2,635 commits · Last activity 2026-09-30 · +0.3% stars, 30d · Default branch at 3.3.2.9000, ahead of CRAN 3.3.2 (checked 2026-10-11)
Responsiveness
How these are sampled
PRs merged (all time)
79%
Median days to close, 50 most recently updated closed issues
11
Median days to close, 50 most recently updated closed PRs
3

Stars over time

2025-10-04 · 9062026-10-13 · 942
PracticesBeta

16 development-tooling and community-health practices detected across 7 families in the upstream repository

Checks run against github.com/r-lib/testthat on 2026-10-11.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (2)
Code of conductCODEOWNERS
Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-09-30 · The repository has a site deploy workflow

pkgdown site last built 2026-01-12

Coverage (2)
Coverage reporting (Codecov).covrignore
Show all practicesHide 3 practices
CRAN release process (2)
cran-comments.mdrevdep/
Lint, format, editor (3)
AirVS CodeRStudio project
Git structural (1)
.gitattributes
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2025-07-30
    Seen in the repository: .claude, .claude/skills
    Named in .Rbuildignore: .claude
How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
31 external dependencies (excludes base and recommended)

Installing testthat adds 23 packages (10 with compiled code, 5.8 MB of source tarballs). Heaviest: fs 1.4 MB, jsonlite 1.0 MB, rlang 766 KB.

Depends (1)
R >= 4.1.0
LinkingTo (0)
none
Enhances (0)
none

People & History

People (3)
Author, Maintainer since 0.1 (2009)
Contributor · added in 2.0.0
Implementation of utils::recover()
Copyright holder, Funder · added in 3.1.8
Listed in earlier versions (2)
Hadley Wickham <hadley@rstudio.com> [aut, cre] RStudio [cph]
no longer listed · 0.9 to 0.9.1
RStudio
no longer listed · 0.10.0 to 3.1.7
Releases (51)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • 3.3.2Latest
    record
    2026-01-11 · current release · diff ↗ ·
    removed 1 export
    default_parallel_reporter
    added 1 export
    LlmReporter
  • 3.3.1
    record
    2025-11-25 · diff ↗
  • 3.3.0
    record
    2025-11-13 · diff ↗ ·
    removed 4 exports
    is_false, is_null, is_true, matches
    added 18 exports
    SlowReporter, expect_all_equal, expect_all_false, expect_all_true, expect_disjoint, expect_r6_class, expect_shape, extract_test, local_mocked_r6_class, local_mocked_s3_method, local_mocked_s4_method, local_on_cran, mock_output_sequence, pass, simulate_test_env, skip_unless_r, snapshot_download_gh, snapshot_reject
  • R
    R 4.5.0 released · 2025-04-11
  • 3.2.3
    record
    2025-01-13 · diff ↗
  • 3.2.2
    record
    2024-12-10 · diff ↗ ·
    added 4 exports
    expect_no_failure, expect_no_success, expect_s7_class, expect_snapshot_failure
  • R
    R 4.4.0 released · 2024-04-24
  • 3.2.1.1
    record
    2024-04-14 · diff ↗
  • 3.2.1
    record
    2023-12-02 · diff ↗
  • 3.2.0
    record
    2023-10-06 · diff ↗
  • 3.1.10
    record
    2023-07-07 · diff ↗
  • 3.1.9
    record
    2023-06-16 · diff ↗ ·
    added 5 exports
    expect_contains, expect_in, is_checking, is_snapshot, set_state_inspector
  • 3.1.8
    record
    2023-05-04 · diff ↗ ·
    added 1 export
    it
  • R
    R 4.3.0 released · 2023-04-21
  • 3.1.7
    record
    2023-03-12 · diff ↗ ·
    added 2 exports
    local_mocked_bindings, with_mocked_bindings
Show 55 earlier eventsHide 55 earlier events
  • 3.1.6
    record
    2022-12-10 · diff ↗
  • 3.1.5
    record
    2022-10-08 · diff ↗ ·
    added 5 exports
    expect_no_condition, expect_no_error, expect_no_message, expect_no_warning, set_max_fails
  • 3.1.4
    record
    2022-04-26 · diff ↗
  • R
    R 4.2.0 released · 2022-04-22
  • 3.1.3
    record
    2022-03-29 · diff ↗
  • 3.1.2
    record
    2022-01-20 · diff ↗ ·
    added 1 export
    expect_snapshot_warning
  • 3.1.1
    record
    2021-12-03 · diff ↗
  • 3.1.0
    record
    2021-10-04 · diff ↗
  • 3.0.4
    record
    2021-07-01 · diff ↗
  • 3.0.3
    record
    2021-06-17 · diff ↗ ·
    added 4 exports
    announce_snapshot_file, compare_file_binary, compare_file_text, expect_no_match
  • R
    R 4.1.0 released · 2021-05-18
  • 3.0.2
    record
    2021-02-14 · diff ↗
  • 3.0.1
    record
    2020-12-17 · diff ↗ ·
    removed 1 export
    RstudioReporter
    added 1 export
    RStudioReporter
  • 3.0.0
    record
    2020-10-31 · diff ↗ ·
    removed 1 export
    expect_known_failure
    added 23 exports
    CompactProgressReporter, ParallelProgressReporter, context_start_file, default_compact_reporter, default_parallel_reporter, edition_get, expect_snapshot, expect_snapshot_error, expect_snapshot_file, expect_snapshot_output, expect_snapshot_value, is_parallel, local_edition, local_reproducible_output, local_snapshotter, local_test_context, local_test_directory, run_cpp_tests, snapshot_accept, snapshot_review, teardown_env, test_local, testthat_print
  • R
    R 4.0.0 released · 2020-04-24
  • 2.3.2
    record
    2020-03-02 · diff ↗
  • 2.3.1
    record
    2019-12-01 · diff ↗
  • 2.3.0
    record
    2019-11-05 · diff ↗ ·
    added 4 exports
    exp_signal, is_informative_error, new_expectation, testthat_tolerance
  • 2.2.1
    record
    2019-07-25 · diff ↗
  • 2.2.0
    record
    2019-07-22 · diff ↗ ·
    added 2 exports
    skip_on_covr, verify_output
  • R
    R 3.6.0 released · 2019-04-26
  • 2.1.1
    record
    2019-04-24 · diff ↗
  • 2.1.0
    record
    2019-04-23 · diff ↗ ·
    removed 1 export
    check_repoter
    added 11 exports
    check_reporter, expect_invisible, expect_mapequal, expect_vector, expect_visible, local_mock, skip_if_offline, skip_on_ci, testing_package, testthat_example, testthat_examples
  • 2.0.1
    record
    2018-10-13 · diff ↗
  • R
    R 3.5.0 released · 2018-04-23
  • 2.0.0
    record
    2017-12-13 · diff ↗ ·
    added 29 exports
    DebugReporter, JunitReporter, LocationReporter, ProgressReporter, capture_condition, capture_error, capture_expectation, capture_message, capture_output_lines, capture_warning, check_repoter, default_reporter, expect_condition, expect_known_failure, expect_known_hash, expect_known_output, expect_known_value, expect_reference, expect_setequal, is_testing, quasi_label, setup, show_failure, skip_if, skip_if_translated, source_test_setup, source_test_teardown, teardown, test_rd
  • R
    R 3.4.0 released · 2017-04-21
  • R
    R 3.3.0 released · 2016-05-03
  • 1.0.2
    record
    2016-04-23 · diff ↗
  • 1.0.1
    record
    2016-04-21 · diff ↗ ·
    added 1 export
    expect_output_file
  • 1.0.0
    record
    2016-04-14 · diff ↗ ·
    added 19 exports
    %>%, FailReporter, capture_messages, capture_output, capture_warnings, expect, expect_cpp_tests_pass, expect_failure, expect_length, expect_s3_class, expect_s4_class, expect_success, expect_type, skip_if_not, skip_on_bioc, source_file, test_path, try_again, use_catch
  • 0.11.0
    record
    2015-10-14 · diff ↗ ·
    added 7 exports
    expect_gt, expect_gte, expect_lt, expect_lte, expect_silent, skip_on_appveyor, skip_on_os
  • 0.10.0
    record
    2015-05-22 · diff ↗ ·
    removed 2 exports
    colourise, library_if_available
    added 10 exports
    CheckReporter, RstudioReporter, compare, find_test_scripts, skip_if_not_installed, skip_on_travis, source_test_helpers, succeed, test_example, test_examples
  • R
    R 3.2.0 released · 2015-04-16
  • 0.9.1
    record
    2014-10-01 · diff ↗
  • 0.9
    record
    2014-09-22 · diff ↗ ·
    added 6 exports
    describe, equals_reference, expect_equal_to_reference, skip, skip_on_cran, with_mock
  • R
    R 3.1.0 released · 2014-04-10
  • 0.8.1
    record
    2014-02-22 · diff ↗
  • 0.8
    record
    2014-02-20 · diff ↗ ·
    added 21 exports
    ListReporter, MultiReporter, Reporter, SilentReporter, TeamcityReporter, evaluate_promise, expect_less_than, expect_more_than, expect_named, expect_null, get_reporter, has_names, is.expectation, is_less_than, is_more_than, is_null, not, set_reporter, test_check, test_env, with_reporter
  • R
    R 3.0.0 released · 2013-04-03
  • 0.7.1
    record
    2013-03-27 · diff ↗ ·
    added 2 exports
    TapReporter, fail
  • 0.7
    record
    2012-06-27 · diff ↗ ·
    added 1 export
    make_expectation
  • R
    R 2.15.0 released · 2012-03-30
  • 0.6
    record
    2011-12-30 · diff ↗
  • R
    R 2.14.0 released · 2011-10-31
  • 0.5
    record
    2011-06-01 · diff ↗
  • R
    R 2.13.0 released · 2011-04-13
  • 0.4
    record
    2011-03-20 · diff ↗ ·
    added 1 export
    expectation
  • R
    R 2.12.0 released · 2010-10-15
  • 0.3
    record
    2010-08-31 · diff ↗ ·
    added 14 exports
    expect_is, expect_true, expect_false, expect_equal, expect_equivalent, expect_identical, expect_match, expect_output, expect_error, gives_warning, expect_warning, shows_message, expect_message, test_package
  • 0.2
    record
    2010-07-25 · diff ↗ ·
    added 24 exports
    auto_test, auto_test_package, colourise, context, expect_that, is_a, is_true, is_false, equals, is_equivalent_to, is_identical_to, matches, prints_text, throws_error, takes_less_than, library_if_available, MinimalReporter, StopReporter, SummaryReporter, test_dir, source_dir, test_file, test_that, watch
  • R
    R 2.11.0 released · 2010-04-22
  • 0.1.1
    record
    2009-11-30 · diff ↗
  • 0.1
    record
    2009-11-17
  • R
    R 2.10.0 released · 2009-10-26

Package metadata

First published
2009-11-17
Total releases
51 / 17 yrs
License
MIT + file LICENSE OSI · relicensed from GPL in 0.8
Minimum R
≥ 4.1.0
Download size
814 KB

Cite

Cite this package

Run in R for the authors' entry:

citation("testthat")

The package provides a citation file, so citation() returns the authors' own entry.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for testthat version 3.3.2 [Data set]. HJJB, LLC. Data release v2026-10-17. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-17, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy