r-lib/testthat
关于
让测试变得 😀 的 R 📦。
开发工具实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- +1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文testthat 
Overview
Testing your code can be painful and tedious, but it greatly increases the quality of your code. testthat tries to make testing as fun as possible, so that you get a visceral satisfaction from writing tests. Testing should be addictive, so you do it all the time. To make that happen, testthat:
Provides functions that make it easy to describe what you expect a function to do, including catching errors, warnings, and messages.
Easily integrates in your existing workflow, whether it’s informal testing on the command line, building test suites, or using R CMD check.
Displays test progress visually, showing a pass, fail, or error for every expectation. If you’re using the terminal or a recent version of RStudio, it’ll even colour the output.
testthat draws inspiration from the xUnit family of testing packages, as well as from many of the innovative ruby testing libraries, like rspec, testy, bacon and cucumber.
testthat is the most popular unit testing package for R and is used by thousands of CRAN packages.
If you’re not familiar with testthat, the testing chapter in R packages gives a good overview, along with workflow advice and concrete examples.
Installation
# Install the released version from CRAN
install.packages("testthat")
# Or the development version from GitHub:
# install.packages("pak")
pak::pak("r-lib/testthat")
Usage
The easiest way to get started is with
usethis. Assuming you’re in a
package directory, just run usethis::use_test("name") to create a test
file, and set up all the other infrastructure you need. If you’re using
RStudio, press Cmd/Ctrl + Shift + T (or run devtools::test() if not)
to run all the tests in a package.
探索相关项目
加载中…