You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+
## About This Project
6
+
7
+
testthat is R's most popular unit testing framework, used by thousands of CRAN packages. It provides functions to make testing R code as fun and addictive as possible, with clear expectations, visual progress indicators, and seamless integration with R package development workflows.
8
+
9
+
## Key Development Commands
10
+
11
+
### Testing
12
+
-`devtools::test()` or `Ctrl/Cmd+Shift+T` in RStudio - Run all tests
13
+
-`devtools::test_file("tests/testthat/test-filename.R")` - Run tests in a specific file
14
+
-`testthat::test_local()` - Run tests for local source package
15
+
-`testthat::test_package("testthat")` - Run tests for installed package
16
+
-`R CMD check` - Full package check including tests
17
+
18
+
### Building and Installation
19
+
-`devtools::load_all()` or `Ctrl/Cmd+Shift+L` - Load package for development
-`Config/testthat/start-first` - Tests to run first in parallel mode
74
+
75
+
### C++ Testing Infrastructure
76
+
77
+
testthat provides C++ testing capabilities via Catch framework:
78
+
- Headers in `inst/include/testthat/`
79
+
- Test runner infrastructure in `src/test-runner.cpp`
80
+
- Integration with R's testing system
81
+
82
+
### Snapshot Testing Workflow
83
+
84
+
- Snapshots stored in `tests/testthat/_snaps/`
85
+
- Different snapshot types: values, files, output
86
+
- Version-specific snapshots for different R versions
87
+
- Use `testthat::snapshot_accept()` to update snapshots
88
+
89
+
This codebase prioritizes backward compatibility, comprehensive testing, and clear, descriptive error messages to help R developers write better tests.
Copy file name to clipboardExpand all lines: NEWS.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
# testthat (development version)
2
2
3
3
* New `local_on_cran(TRUE)` allows you to simulate how your tests will run on CRAN (#2112).
4
+
*`expect_no_*()` now executes the entire code block, rather than stopping at the first message or warning (#1991).
5
+
*`expect_no_failures()` and `expect_no_successes()` are now deprecated as `expect_success()` now test for no failures and `expect_failure()` tests for no successes (#)
4
6
* New `pass()` function to use in place of `succeed()` (#2113).
5
7
*`expectation()` is now a combination of `new_expectation()` and `exp_signal()` (#2125).
6
8
*`is_null()`/`matches()` deprecated in 2.0.0 (2017-12-19) and `is_true()`/`is_false()` deprecated in 2.1.0 (2019-04-23) have been removed (#2109).
0 commit comments