-
Notifications
You must be signed in to change notification settings - Fork 301
Description
{testthat} 3.2.0 includes a new evolution for mocking in tests: with_mocked_bindings()
and local_mocked_bindings()
.
One aspect of this is we're encouraged to add placeholders for {base}-mocked functions in our package namespace:
To mock a function in the base package, you need to make sure that you have a binding for this function in your package. It's easiest to do this by binding the value to
NULL
.
As a package grows/the number of base functions to mock becomes scattered throughout the package, confusion may ensue. This reminds me of how use_package_doc()
allots space in the template file for all the #' @import
/ #' @importFrom
tags to live:
usethis/inst/templates/packagename-package.R
Lines 4 to 5 in 0de0d45
## usethis namespace: start | |
## usethis namespace: end |
Should use_package_doc()
now also set aside some space for mocked binding {base} placeholders as well?