Crandore Hub

mockthat

Function Mocking for Unit Testing

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.

Versions across snapshots

VersionRepositoryFileSize
0.2.8 rolling source/ R- mockthat_0.2.8.tar.gz 12.9 KiB
0.2.8 latest source/ R- mockthat_0.2.8.tar.gz 12.9 KiB
0.2.8 2026-04-09 windows/windows R-4.5 mockthat_0.2.8.zip 39.1 KiB

Dependencies (latest)

Imports

Suggests