All Projects → r-lib → Testthat

r-lib / Testthat

Licence: other
An R 📦 to make testing 😀

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Testthat

Codeception
Full-stack testing PHP framework
Stars: ✭ 4,401 (+512.1%)
Mutual labels:  unit-testing
Jasmine Matchers
Write Beautiful Specs with Custom Matchers for Jest and Jasmine
Stars: ✭ 552 (-23.23%)
Mutual labels:  unit-testing
Php Censor
PHP Censor is an open source self-hosted continuous integration server for PHP projects.
Stars: ✭ 619 (-13.91%)
Mutual labels:  unit-testing
System Rules
A collection of JUnit rules for testing code which uses java.lang.System.
Stars: ✭ 492 (-31.57%)
Mutual labels:  unit-testing
Ut
UT: C++20 μ(micro)/Unit Testing Framework
Stars: ✭ 507 (-29.49%)
Mutual labels:  unit-testing
Otj Pg Embedded
Java embedded PostgreSQL component for testing
Stars: ✭ 559 (-22.25%)
Mutual labels:  unit-testing
Service Pattern Go
Simple clean Go REST API architecture with dependency injection and mocking example, following SOLID principles.
Stars: ✭ 449 (-37.55%)
Mutual labels:  unit-testing
Ios Mvp Clean Architecture
Demo iOS application built to highlight MVP (Model View Presenter) and Clean Architecture concepts
Stars: ✭ 637 (-11.4%)
Mutual labels:  unit-testing
Platformio Core
PlatformIO is a professional collaborative platform for embedded development 👽 A place where Developers and Teams have true Freedom! No more vendor lock-in!
Stars: ✭ 5,539 (+670.38%)
Mutual labels:  unit-testing
Deepstate
A unit test-like interface for fuzzing and symbolic execution
Stars: ✭ 603 (-16.13%)
Mutual labels:  unit-testing
Expecto
A smooth testing lib for F#. APIs made for humans! Strong testing methodologies for everyone!
Stars: ✭ 495 (-31.15%)
Mutual labels:  unit-testing
Cmake Examples
Useful CMake Examples
Stars: ✭ 7,220 (+904.17%)
Mutual labels:  unit-testing
Kotlin Coroutines Android Examples
Learn Kotlin Coroutines for Android by Examples. Learn how to use Kotlin Coroutines for Android App Development.
Stars: ✭ 572 (-20.45%)
Mutual labels:  unit-testing
Xctesthtmlreport
Xcode-like HTML report for Unit and UI Tests
Stars: ✭ 489 (-31.99%)
Mutual labels:  unit-testing
Vstest
Visual Studio Test Platform is the runner and engine that powers test explorer and vstest.console.
Stars: ✭ 624 (-13.21%)
Mutual labels:  unit-testing
Electron Nuxt
⚡ An Electron & Nuxt.js / Vue.js quick start boilerplate with vue-cli scaffolding, electron-builder, unit/e2e testing, vue-devtools
Stars: ✭ 452 (-37.13%)
Mutual labels:  unit-testing
Java Dns Cache Manipulator
🌏 A simple 0-dependency thread-safe Java™ lib/tool for setting dns programmatically without touching host file, make unit/integration test portable.
Stars: ✭ 557 (-22.53%)
Mutual labels:  unit-testing
Cmockery
A lightweight library to simplify and generalize the process of writing unit tests for C applications.
Stars: ✭ 697 (-3.06%)
Mutual labels:  unit-testing
Pgtap
PostgreSQL Unit Testing Suite
Stars: ✭ 631 (-12.24%)
Mutual labels:  unit-testing
Robolectric
Android Unit Testing Framework
Stars: ✭ 5,372 (+647.15%)
Mutual labels:  unit-testing

testthat

CRAN status R build status Codecov test coverage

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("devtools")
devtools::install_github("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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].