Skip to content

mockr

Mocking in R

v0.2.2 · May 1, 2025 · MIT + file LICENSE

Description

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

Downloads

CRAN

25.4K

Last 30 days

716th

73.6K

Last 90 days

785.2K

Last year

Trend: +7.9% (30d vs prior 30d)

r2u CRAN

82

Last 30 days

471

Last 90 days

1.3K

Last year

Trend: -43.5% (30d vs prior 30d)

autoCRAN

2

Last 7 days

7

Last 30 days

0

All-time

autoCRAN-only: this name is served only by autoCRAN, so the count is exact.

CRAN Check Status

13 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Reverse Dependencies (16)

Dependency Network

Dependencies Reverse dependencies rlang withr ROCaggregator corehunter dosearch gluedown gptstudio knitrProgressBar mctq metro miniCRAN onetime pestr storr tidyhte tidysq tidyverse +1 more reverse deps mockr

Version History

5 tracked
new 0.2.2 Mar 10, 2026
updated 0.2.2 ← 0.2.1 diff Apr 30, 2025
updated 0.2.1 ← 0.2.0 diff Jan 31, 2023
updated 0.2.0 ← 0.1 diff Apr 1, 2022
new 0.1 Apr 28, 2017