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

Example) Shinytest2 vs module #6

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

russHyde
Copy link
Collaborator

Uses a module-specific app, into which data/reactives can be passed, to demonstrate that shinytest2 can be used to test components.

This example is a bit pointless, the same idea can be tested using testServer, and the workshop attendees do this in the subsequent exercise.

This fails to get the shinytest2 test to run (unless unstats is
installed) because are references to unstats::un_data in the app code.
Any references to the package-under-development can be problematic,
because the R session where the app runs must have access to the package
itself.
Note that pkgload is added to Suggests rather than Imports.
golem::add_rstudioconnect_file() adds pkgload to Imports, which throws a
'note' in R CMD check (because the package doesn't actually use it).
This circumvents problems with loading the dev version of the package
into the session where the app runs during tests, because it uses
pkgload::load_all() in the app.R file.
…MD check

But always remember to 'install' your package before using
devtools::test()
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

Successfully merging this pull request may close these issues.

1 participant