testit: A Simple Package for Testing R Packages

A minimal, dependency-free testing framework for R packages. Write tests as simple R expressions that return TRUE, using assert() for assertions (with informative error messages on failure), has_error() / has_warning() / has_message() for testing conditions, and test_pkg() to run all tests with full access to internal (non-exported) package functions. Snapshot testing via Markdown files is also supported.

Getting started

Package details

AuthorYihui Xie [aut, cre] (ORCID: <https://orcid.org/0000-0003-0645-5666>, URL: https://yihui.org), Tomas Kalibera [ctb], Steven Mortimer [ctb]
MaintainerYihui Xie <xie@yihui.name>
LicenseMIT + file LICENSE
Version1.2
URL https://github.com/yihui/testit 
Package repositoryView on CRAN
Installation Install the latest version of this package by entering the following in R:
install.packages("testit")

Try the testit package in your browser

Any scripts or data that you put into this service are public.

testit documentation built on Oct. 16, 2026, 1:06 a.m.