{Testthat} now also includes the possibility to mock functions via with_mocking_bindings/local_mocking_bindings.
This doesn't work with {shinytest2} when trying to setup a mock before calling AppDriver$new(), the mocked function is still returning the original values. Is this connected to https://github.com/rstudio/shinytest2/issues/301 and in general not possible currently?
If yes, is there a workaround to change some function bindings for AppDriver?
Basically, I want to mock external data connectors (e.g. database connections or directly the data via fixtures), which are used by the application without adding some conditional test files/function outputs in the productive code.
Happy to hear I missed something or open to discuss any ideas to contribute.
{Testthat} now also includes the possibility to mock functions via
with_mocking_bindings
/local_mocking_bindings
. This doesn't work with {shinytest2} when trying to setup a mock before callingAppDriver$new()
, the mocked function is still returning the original values. Is this connected to https://github.com/rstudio/shinytest2/issues/301 and in general not possible currently?If yes, is there a workaround to change some function bindings for
AppDriver
?Basically, I want to mock external data connectors (e.g. database connections or directly the data via fixtures), which are used by the application without adding some conditional test files/function outputs in the productive code.
Happy to hear I missed something or open to discuss any ideas to contribute.