Mocking in R
Overview
Provides a means to mock a package function, i.e., temporarily substitute it for testing. Designed as a drop-in replacement for the now deprecated 'testthat::with_mock()' and 'testthat::local_mock()'.
License
- Relicense as MIT.
Bug fixes
- Avoid rendering vignette with usethis missing.
- More careful querying of functions to be mocked, to avoid errors for
.onLoad()when testing interactively (#29).
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 3 (1 internal)includes a package overview page
- Examples that run
- 100%1 run in a plain check
- Exported functions with examples
- 50%
- Documented parameters
- 100%
- Return-value docs
- 50%
- Help pages citing references
- 33%
- Mocking with mockr HTML
Downloads
Repository
- PRs merged (all time)
- 92%
- Median days to close, 50 most recently updated closed issues
- 56
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
10 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/krlmlr/mockr on 2026-10-22.
The R CMD check workflow runs on Linux and Windows
GitHub Pages site last deployed 2026-09-27 · The repository has a site deploy workflow
pkgdown site last built 2026-09-27
Show all practicesHide 2 practices
This repository shows signs of AI coding tools.
- Claude Codefirst seen on or before 2026-05-16Pull request it wrote: opened by a project memberCommits: 3 by its own account · at least 38 crediting it in the message
- Claude Opus 513 commits · Aug to Sep 2026
- Claude Opus 5.53 commits · Sep 2026
- Claude Fable 51 commit · Aug 2026
Dependencies
Installing mockr adds 2 packages (1 with compiled code, 868 KB of source tarballs). Heaviest: rlang 766 KB, withr 102 KB.
Show all 18 packagesHide all 18 packages
Code & Tests
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 0.2.2Latest
- 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.12023-02-01 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 0.2.0
- RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- RR 3.6.0 released · 2019-04-26
- RR 3.5.0 released · 2018-04-23
- 0.12017-04-29
- RR 3.4.0 released · 2017-04-21
Package metadata
- First published
- 2017-04-29
- Total releases
- 4 / 9 yrs
- License
- MIT + file LICENSE OSI · relicensed from GPL-3 in 0.2.2
- Download size
- 20 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("mockr")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.