You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
{testthat} 3.2.0 includes a new evolution for mocking in tests:
with_mocked_bindings()
andlocal_mocked_bindings()
.One aspect of this is we're encouraged to add placeholders for {base}-mocked functions in our package namespace:
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
Should
use_package_doc()
now also set aside some space for mocked binding {base} placeholders as well?The text was updated successfully, but these errors were encountered: