{"id":13937737,"url":"https://github.com/r-lib/testthat","last_synced_at":"2026-04-02T02:17:01.314Z","repository":{"id":652767,"uuid":"295311","full_name":"r-lib/testthat","owner":"r-lib","description":"An R 📦 to make testing 😀","archived":false,"fork":false,"pushed_at":"2026-03-02T17:41:27.000Z","size":22638,"stargazers_count":926,"open_issues_count":16,"forks_count":342,"subscribers_count":15,"default_branch":"main","last_synced_at":"2026-03-02T20:57:44.357Z","etag":null,"topics":["r","unit-testing"],"latest_commit_sha":null,"homepage":"https://testthat.r-lib.org","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-lib.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2009-09-02T12:51:44.000Z","updated_at":"2026-03-02T17:35:26.000Z","dependencies_parsed_at":"2025-12-17T01:03:05.238Z","dependency_job_id":null,"html_url":"https://github.com/r-lib/testthat","commit_stats":{"total_commits":2141,"total_committers":141,"mean_commits":"15.184397163120567","dds":0.3876693134049509,"last_synced_commit":"f060ccec365e1343ae926c53c215a423b295d7a8"},"previous_names":["hadley/testthat"],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/r-lib/testthat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Ftestthat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Ftestthat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Ftestthat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Ftestthat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-lib","download_url":"https://codeload.github.com/r-lib/testthat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Ftestthat/sbom","scorecard":{"id":13575,"data":{"date":"2025-08-04","repo":{"name":"github.com/r-lib/testthat","commit":"8f16f265344812dae401bab7bf8b2a23dc33382f"},"scorecard":{"version":"v5.2.1-28-gc1d103a9","commit":"c1d103a9bb9f635ec7260bf9aa0699466fa4be0e"},"score":5.7,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#packaging"}},{"name":"Maintained","score":10,"reason":"30 commit(s) and 27 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#maintained"}},{"name":"Code-Review","score":4,"reason":"Found 14/30 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/pkgdown.yaml:24","Warn: jobLevel 'contents' permission set to 'write': .github/workflows/pr-commands.yaml:19","Warn: jobLevel 'contents' permission set to 'write': .github/workflows/pr-commands.yaml:58","Info: topLevel permissions set to 'read-all': .github/workflows/R-CMD-check.yaml:14","Info: topLevel permissions set to 'read-all': .github/workflows/pkgdown.yaml:13","Info: topLevel permissions set to 'read-all': .github/workflows/pr-commands.yaml:9","Info: topLevel permissions set to 'read-all': .github/workflows/test-coverage.yaml:10"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/R-CMD-check.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/R-CMD-check.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/R-CMD-check.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/R-CMD-check.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:64: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/R-CMD-check.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/pkgdown.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/pkgdown.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/pkgdown.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/pkgdown.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/pkgdown.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/pr-commands.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:83: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/pr-commands.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-coverage.yaml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/test-coverage.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test-coverage.yaml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/test-coverage.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test-coverage.yaml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/test-coverage.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test-coverage.yaml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/test-coverage.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-coverage.yaml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/testthat/test-coverage.yaml/main?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  18 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#vulnerabilities"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-14T15:10:29.587Z","repository_id":652767,"created_at":"2025-08-14T15:10:29.587Z","updated_at":"2025-08-14T15:10:29.587Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31294479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:43:37.129Z","status":"online","status_checked_at":"2026-04-02T02:00:08.535Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["r","unit-testing"],"created_at":"2024-08-07T23:03:49.852Z","updated_at":"2026-04-02T02:17:01.284Z","avatar_url":"https://github.com/r-lib.png","language":"R","readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\"\n)\n```\n\n# testthat \u003ca href=\"https://testthat.r-lib.org\"\u003e\u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"138\" alt=\"\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/testthat)](https://cran.r-project.org/package=testthat)\n[![R-CMD-check](https://github.com/r-lib/testthat/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/testthat/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/r-lib/testthat/graph/badge.svg)](https://app.codecov.io/gh/r-lib/testthat)\n\u003c!-- badges: end --\u003e\n\n## Overview\n\nTesting 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:\n\n* Provides functions that make it easy to describe what you expect a\n  function to do, including catching errors, warnings, and messages.\n\n* Easily integrates in your existing workflow, whether it's informal testing\n  on the command line, building test suites, or using R CMD check.\n\n* Displays test progress visually, showing a pass, fail, or error for every\n  expectation. If you're using the terminal or a recent version of RStudio,\n  it'll even colour the output.\n\ntestthat draws inspiration from the xUnit family of testing packages, as well as from many of the innovative ruby testing libraries, like [rspec](https://rspec.info/), [testy](https://github.com/ahoward/testy), [bacon](https://github.com/leahneukirchen/bacon) and [cucumber](https://cucumber.io).\n\ntestthat is the most popular unit testing package for R and is used by thousands of CRAN packages.\n\nIf you're not familiar with testthat, the [testing chapter](https://r-pkgs.org/testing-basics.html) in [R packages](https://r-pkgs.org) gives a good overview, along with workflow advice and concrete examples.\n\n## Installation\n\n```{r, eval = FALSE}\n# Install the released version from CRAN\ninstall.packages(\"testthat\")\n\n# Or the development version from GitHub:\n# install.packages(\"pak\")\npak::pak(\"r-lib/testthat\")\n```\n\n## Usage\n\nThe easiest way to get started is with [usethis](https://github.com/r-lib/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.\n","funding_links":[],"categories":["R","Table of Contents"],"sub_categories":["Development in R"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Ftestthat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-lib%2Ftestthat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Ftestthat/lists"}