mockthat
0.2.8Function Mocking for Unit Testing
Overview
With the deprecation of mocking capabilities shipped with 'testthat' as of 'edition 3' it is left to third-party packages to replace this functionality, which in some test-scenarios is essential in order to run unit tests in limited environments (such as no Internet connection). Mocking in this setting means temporarily substituting a function with a stub that acts in some sense like the original function (for example by serving a HTTP response that has been cached as a file). The only exported function 'with_mock()' is modeled after the eponymous 'testthat' function with the intention of providing a drop-in replacement.
Install
Health
- OK2026-08-0513 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
- NOTE2026-08-0112 OK · 1 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
- OK2026-03-1014 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
Documentation
- Examples that run
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- References docs
- 0%
Downloads
Repository
Stars over time
Forks over time
Issues over time
PRs over time
Repository practices
3 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/nbenn/mockthat on 2026-08-16.
Dependencies
Code & Tests
People & History
3 releases. Pick two to compare their code metrics. R releases are shown for context.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- 0.2.8Latest
- unarchivedReturned to CRAN2022-11-01
- archivedRemoved from CRAN2022-10-18issues were not corrected in time
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- 0.2.62021-04-23 · diff ↗
- 0.2.42020-12-09
- RR 4.0.0 released · 2020-04-24
Package metadata
- First published
- 2020-12-09
- Total releases
- 3 / 6 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 3.3.0
- Download size
- 13 KB
- Installed size
- not tracked yet
- With dependencies
- not tracked yet
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("mockthat")This is what citation() produces when a package has no citation file of its own. If it prints something else, use that.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-08-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.