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
I'm trying to create a unit test where I set a variable at the start of the {testthat} unit test and use that variable in a shiny app, then use {shinytest2} to test the app. However, it seems like I can't refer to that variable when wrapping my app in an AppDriver.
Upon further investigation, it seems like the problem is more nuanced. If you place foo inside the UI, then the app works fine. Placing foo inside the server causes the error.
Activity
daattali commentedon Jan 9, 2023
Upon further investigation, it seems like the problem is more nuanced. If you place
fooinside the UI, then the app works fine. Placingfooinside the server causes the error.Perhaps related to #296
schloerke commentedon Jan 10, 2023
I can duplicate the error if run in the R console.
The error goes away if run within a testthat file.
Are you running your code in the R console?
I can get this to work as expected in the R console:
If
foo3is outside oflocal()and run in the R console, it will fail.Fails:
schloerke commentedon Jan 10, 2023
I believe I've found a fix. Will make a PR tomorrow.