Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use local_mocking_bindings from {testthat} or how change function bindings with {shinytest2} #371

Open
Fideldue opened this issue Dec 13, 2023 · 1 comment

Comments

@Fideldue
Copy link

{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 #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.

@Fideldue
Copy link
Author

Any news or ideas on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant