Skip to content

mockr

0.2.2Package record

Mocking in R

0packages dependsuggested by 18
481Kdownloads / year
85.5%test coverage
13/13flavors OK

Overview

About

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()'.

Changes in 0.2.2

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

CRAN checks
13OK
Slowest check: 1.3 min · r-oldrel-macos-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.2.2
READMEYes · 393 wordsVignettesYes · 1 · evaluation depends on the environmentNEWSYes · 100% structured · mentions 0.2.2Citation fileNoWebsiteYes · pkgdown
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%
Vignettes (1)

Downloads

481K
CRAN downloads in the past year
Rank #790 · ~1.3K/day · ~40.1K/mo
Daily download trend is not available in this view yet.
17.3K30 days
58.9K90 days
481K1 year
Compare downloads with other packages →
Also on1.2K r2u4 autocran520 conda_forge19 c2d4u

Repository

19Stars
3Forks
2Open issues
3Open PRs
4Releases
448Commits
6Commit identities
448 commits · Last activity 2026-10-10 · 0% stars, 30d · Default branch at 0.2.2.9024, ahead of CRAN 0.2.2 (checked 2026-10-22)
Responsiveness
How these are sampled
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

2024-05-31 · 182026-09-16 · 19
PracticesBeta

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.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux and Windows

Governance and community (1)
Code of conduct
Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-09-27 · The repository has a site deploy workflow

pkgdown site last built 2026-09-27

Coverage (1)
Coverage reporting (Codecov)
Show all practicesHide 2 practices
CRAN release process (1)
cran-comments.md
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen on or before 2026-05-16
    Pull request it wrote: opened by a project member
    Commits: 3 by its own account · at least 38 crediting it in the message
Models named in its commits
  • Claude Opus 513 commits · Aug to Sep 2026
  • Claude Opus 5.53 commits · Sep 2026
  • Claude Fable 51 commit · Aug 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
9 external dependencies (excludes base and recommended)

Installing mockr adds 2 packages (1 with compiled code, 868 KB of source tarballs). Heaviest: rlang 766 KB, withr 102 KB.

Depends (0)
none
Imports (2)
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect
Suggested by 18
Show all 18 packagesHide all 18 packages
Suggests, most downloaded first

People & History

People (1)
Author, Maintainer since 0.1 (2017)
Releases (4)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • 0.2.2Latest
    record
    2025-05-01 · current release · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • 0.2.1
    record
    2023-02-01 · diff ↗
  • R
    R 4.2.0 released · 2022-04-22
  • 0.2.0
    record
    2022-04-02 · diff ↗ ·
    added 2 exports
    get_mock_env, local_mock
  • R
    R 4.1.0 released · 2021-05-18
  • R
    R 4.0.0 released · 2020-04-24
  • R
    R 3.6.0 released · 2019-04-26
  • R
    R 3.5.0 released · 2018-04-23
  • 0.1
    record
    2017-04-29
  • R
    R 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")
Müller, K. (2025). mockr: Mocking in R (Version 0.2.2) [Computer software]. https://doi.org/10.32614/CRAN.package.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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for mockr version 0.2.2 [Data set]. HJJB, LLC. Data release v2026-10-23. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy