Other packages > Find by keyword >

mockthat  

Function Mocking for Unit Testing
View on CRAN: Click here


Download and install mockthat package within the R console
Install from CRAN:
install.packages("mockthat")

Install from Github:
library("remotes")
install_github("cran/mockthat")

Install by package version:
library("remotes")
install_version("mockthat", "0.2.8")



Attach the package and use:
library("mockthat")
Maintained by
Nicolas Bennett
[Scholar Profile | Author Map]
All associated links for this package
First Published: 2020-12-09
Latest Update: 2022-11-01
Description:
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.
How to cite:
Nicolas Bennett (2020). mockthat: Function Mocking for Unit Testing. R package version 0.2.8, https://cran.r-project.org/web/packages/mockthat. Accessed 07 Aug. 2026.
Previous versions and publish date:
(2026-07-09 06:31), 0.2.4 (2020-12-09 11:20), 0.2.6 (2021-04-23 11:00)
Other packages that cited mockthat R package
View mockthat citation profile
Other R packages that mockthat depends, imports, suggests or enhances
Complete documentation for mockthat
Functions, R codes and Examples using the mockthat R package
Some associated functions: helpers . mock . 
Some associated R codes: helpers.R . mock.R .  Full mockthat package functions and examples
Downloads during the last 30 days

Today's Hot Picks in Authors and Packages

bbricks  
Bayesian Methods and Graphical Model Structures for Statistical Modeling
A set of frequently used Bayesian parametric and nonparametric model structures, as well as a set of ...
Download / Learn more Package Citations See dependency  
BayesESS  
Determining Effective Sample Size
Determines effective sample size of a parametric prior distribution in Bayesian models. For a web-b ...
Download / Learn more Package Citations See dependency  
r2resize  
In-Text Resize for Images, Tables and Fancy Resize Containers in 'shiny', 'rmarkdown' and 'quarto' Documents
Automatic resizing toolbar for containers, images and tables. Various resizable or expandable contai ...
Download / Learn more Package Citations See dependency  
enrichwith  
Methods to Enrich R Objects with Extra Components
Provides the "enrich" method to enrich list-like R objects with new, relevant components. The curren ...
Download / Learn more Package Citations See dependency  
modelwordcloud  
Model Word Clouds
Makes a word cloud of text, sized by the frequency of the word, and colored either by user-specified ...
Download / Learn more Package Citations See dependency  

28,083

R Packages

239,283

Dependencies

74,457

Author Associations

28,084

Publication Badges

© Copyright since 2022. All right reserved, rpkg.net.  Based in Cambridge, Massachusetts, USA