Tools for Mocking
From testthat
Provide tools for “mocking”, temporarily redefining a function so that it behaves differently during tests.
with_mocked_bindings()
local_mocked_bindings()
Other alternatives:
mockery
: https://github.com/r-lib/mockerymockr
: https://krlmlr.github.io/mockr/httptest
: https://enpiar.com/r/httptest/httptest2
: https://enpiar.com/httptest2/webfakes
: https://webfakes.r-lib.org