Skip to content

mockery

0.4.5

Mocking Library for R

173packages depend
1.2Mdownloads / year
99.3%test coverage
13/13checks pass

Overview

About
Maintained by Hadley WickhamFirst published 2016-10-259 releasesCRAN page ↗GitHub ↗

The two main functionalities of this package are creating mock objects (functions) and selectively intercepting calls to a given function that originate in some other function. It can be used with any testing framework available for R. Mock objects can be injected with either this package's own stub() function or a similar with_mocked_binding() facility present in the 'testthat' package.

Install

Health

CRAN checks
13OK
Slowest check: 1.5 min · r-oldrel-macos-x86_64
Code health
Yes
Tests · ratio 1.13
99.3%
Coverage · measured lines
100%
Documentation · exports
1
Dependencies · direct
Check history
  • OK2026-08-05
    13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • NOTE2026-08-01
    12 OK · 1 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • OK2026-03-10
    14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE

Documentation

Documentation
READMEYes · 422 wordsVignettesYes · dynamicpkgdown siteNoNEWSYes · 100% structuredCode of conductNoContributing guideNo
Examples that run
100%
Documented parameters
100%
Return-value docs
33%
References docs
0%

Downloads

1.2M
CRAN downloads in the past year
Rank #465 · ~3.3K/day · ~101.4K/mo
Daily download trend is not available in this view yet.
51K30 days
172.3K90 days
1.2M1 year
Compare downloads with other packages →
Also on7.5K r2u68 autocran5.9K conda_forge20 c2d4u

Repository

Repository
104Stars
10Forks
4Open issues
0Open PRs
8Releases
165Commits
13Contributors
165 commits · Last activity 2025-09-04 · 0% stars, 30d

Stars over time

2025-07-16 · 1022026-07-07 · 104

Repository practices

Upstream repositoryBeta

5 development-tooling and community-health practices detected across 4 families in the upstream repository

Checks run against github.com/r-lib/mockery on 2026-08-16.

Continuous integration (1)
GitHub Actions
CRAN release process (2)
cran-comments.mdrevdep/
Lint, format, editor (1)
RStudio project
Coverage (1)
Codecov
How this is detected·Detection ruleset v1 (2026-07-18)

Dependencies

Declared dependencies
4 external dependencies (excludes base and recommended)
Depends (1)
R >= 3.6
Imports (1)
LinkingTo (0)
none
Suggests (3)
Enhances (0)
none

Code & Tests

People & History

People (4)
Maintainer (1)
Author, Maintainer · added in 0.4.3
Authors (4)
Author, Maintainer · added in 0.4.3
Author · added in 0.4.2
Package Timeline

9 releases. Pick two to compare their code metrics. R releases are shown for context.

  • R
    R 4.6.0 released · 2026-04-24
  • 0.4.5Latest
    2025-09-04 · current release · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • 0.4.4
    2023-09-26 · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • 0.4.3
    2022-02-20 · diff ↗
  • R
    R 4.1.0 released · 2021-05-18
  • R
    R 4.0.0 released · 2020-04-24
  • 0.4.2
    2019-09-04 · diff ↗
  • unarchivedReturned to CRAN
    2019-09-04
  • R
    R 3.6.0 released · 2019-04-26
  • 0.4.1.1
    2018-08-19 · diff ↗
  • orphanedOrphaned by its maintainer
    2018-08-19
    check problems were not corrected despite reminders
  • R
    R 3.5.0 released · 2018-04-23
Show 6 earlier events
  • 0.4.1
    2017-11-10 · diff ↗
  • 0.4.0
    2017-11-07 · diff ↗
  • R
    R 3.4.0 released · 2017-04-21
  • 0.3.0
    2016-12-16 · diff ↗
  • 0.2.0
    2016-10-25
  • R
    R 3.3.0 released · 2016-05-03

Package metadata

First published
2016-10-25
Total releases
9 / 10 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 3.6
Download size
21 KB
Installed size
not tracked yet
With dependencies
not tracked yet

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("mockery")
Wickham, H., Bartnik, L., Finkelstein, N., & Hester, J. (2025). mockery: Mocking Library for R (Version 0.4.5) [Computer software]. https://doi.org/10.32614/CRAN.package.mockery

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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for mockery version 0.4.5 [Data set]. HJJB, LLC. Data release v2026-08-18. https://doi.org/10.5281/zenodo.21843040

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.

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