linkedin.com
#rstats #rshiny #datascience #rstats #shinyapp #rpackagedevelopment #softwaretesting | Barret Schloerke
shinytest2 0.5.0 is Now Available on CRAN I'm excited to announce the release of shinytest2 0.5.0, bringing significant improvements to the R package testing experience for Shiny applications! 🚀 Key Features: Local Package Development Support One of the most requested features is here! `AppDriver$new(app_dir=)` now supports local package development. As long as you have `library()` or `require()` call in your `app.R`, `{shinytest2}` automatically executes `pkgload::load_all()` to load your local R package's source code. This means you no longer need to install your package before testing—a huge time-saver during development! Function Execution Support You can now pass functions directly to `AppDriver$new(app_dir=)`. This provides flexibility for testing apps with dynamic configurations or custom execution environments, such as Shiny packages made using `{golem}`! The function runs in a background R process, similar to `{mirai}`, with full control over the testing environment. Enhanced Package Testing Workflow This release introduces `local_app_support()` and `with_app_support()`, providing package authors with a flexible way to scope app support files within tests. Package authors can now test Shiny applications directly within their package's existing`{testthat}` tests removing the need for calling `test_app()`. This will collect all snapshots in a single location using the package's existing testing infrastructure. Improved Test Recording `record_test()` gained a `record_in_package` parameter that intelligently saves test files to the appropriate location—either in the package's `tests/testthat/` directory or relative to the app's test directory. When recording tests for apps inside packages, `local_app_support()` is automatically added to the testing code. Modernized HTTP Stack Migrated from `{httr}` to `{httr2}` for all HTTP requests, ensuring compatibility with modern R web tooling and better long-term maintenance. 📚 Learn More: - Package website: https://lnkd.in/dt9ZtezY - Use-package vignette: https://lnkd.in/dvv7VRXj - GitHub: https://lnkd.in/dF6rF3CB #rstats #rshiny #DataScience #RStats #ShinyApp #RPackageDevelopment #SoftwareTesting