Skip to content
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: shinytest2
Title: Testing for Shiny Applications
Version: 0.4.1.9002
Version: 0.5.0
Authors@R: c(
person("Barret", "Schloerke", , "barret@posit.co", role = c("cre", "aut"),
comment = c(ORCID = "0000-0001-9986-114X")),
Expand Down
84 changes: 58 additions & 26 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,67 @@
# shinytest2 (development version)
# shinytest2 0.5.0

## Lifecycle changes

## AppDriver
* `load_app_env()` has been superseded by `load_app_support()`. This new
function aligns its name with `local_app_support()` and
`with_app_support()`, and similarly, it requires an `app_dir` parameter
(#328).

* Added support for local package development for the background Shiny App process in `AppDriver$new(app_dir=)`. In the background test R process, any `library(<pkg>)` or `require(<pkg>)` call will automatically execute `pkgload::load_all()` to load the local R package's source code. Installing the package before testing is no longer required! (#402).
* `test_app(check_setup=)` is now deprecated. Checking is no longer required
as default behavior, as `load_app_env()` has been superseded by
`with_app_support()` and `local_app_support()`, which provide a more robust
and flexible way to scope app support files such as `global.R`, `app.R`,
`server.R`, and `ui.R` (#328).

* Added support for function execution for `AppDriver$new(app_dir=)`. You must run the App or document yourself. Similar to `{mirai}`, all packages must be `library()`'d or `require()`'d again as the function is being ran in the background R process (#402).

## Package testing

* For package authors, it is now recommended to test your Shiny applications within your own `{testthat}` tests instead of using `test_app()`. By using your package's existing `{testthat}` infrastructure to test your Shiny applications, collecting snapshots in a single location. Be sure to use `with_app_support()` or `local_app_support()` to load your app's support files as needed. See the [use-package vignette](https://rstudio.github.io/shinytest2/articles/use-package.html) for more details (#328).

* To implement the new test file location app, `record_test()` will now save the test file to the package's `tests/testthat/` directory if the current working directory is within a package given `record_in_package=TRUE` (default). If `record_in_package=FALSE`, the test file will be saved relative to the app's `tests/testthat/` directory. This change helps facilitate using the package's existing testing infrastructure by having unit tests in a single place (#328).

## Bug / Improvements

* Added two new methods: `with_app_support()` and `local_app_support()`. These methods provide package authors a flexible way to scope app support files such as `global.R`, `app.R`, `server.R`, and `ui.R` within your tests. Non-package authors should still use `load_app_support()` within their `setup-shinytest2.R` file. See `?local_app_support` for more details (#328).

* `load_app_env()` has been superseded by `load_app_support()`. This new method aligns its name with `local_app_support()` and `with_app_support()`, and similarly, it requires an `app_dir=` parameter (#328).

* `test_app(check_setup=)` is now deprecated. Checking is no longer required as default behavior. This is because `load_app_env()` is now superseded by two new functions: `with_app_support()` and `local_app_support()`. Each function provides a more robust and flexible way to scope app support files such as `global.R`, `app.R`, `server.R`, and `ui.R`. See `?with_app_support` and `?local_app_support` for more details (#328).

* Given `test_app(check_setup=FALSE)` is now deprecated. This change was done for package authors do not require apps to load support (#328).

* `record_test()` will now only save setup file for local app testing and not within package app testing. When recording a test for an app inside a package, `local_app_support()` will be added to the top of the testing code (#328).

* Fixed internal bug where `{testthat}` v3.3.0 changed expectation behavior for screenshot snapshots within `App$expect_values()` (#418).
## New features

* Migrated from `{httr}` to `{httr2}` for all HTTP requests made by `{shinytest2}` (#420, #428).
* `AppDriver$new(app_dir=)` now supports local package development for the
background Shiny app process. In the background test R process, any
`library(<pkg>)` or `require(<pkg>)` call automatically executes
`pkgload::load_all()` to load the local R package's source code. Installing
the package before testing is no longer required (#402).

* `AppDriver$new(app_dir=)` now supports function execution. You must run the
app (or document) yourself or return a Shiny app object. Similar to `{mirai}`,
all packages must be loaded with `library()` or `require()` again as the
function runs in the background R process (#402).

* Added `local_app_support()`, `with_app_support()`, and `load_app_support()`.
`local_app_support()` and `with_app_support()` provide package authors a
flexible way to scope app support files such as `global.R`, `app.R`,
`server.R`, and `ui.R` within tests. Non-package authors should still use
`load_app_support()` within their `setup-shinytest2.R` file. See
`?local_app_support` for more details (#328).

* `record_test()` gained a `record_in_package` parameter. If `TRUE` (default)
and the current working directory is within a package, the test file is saved
to the package's `tests/testthat/` directory. If `FALSE`, the test file is
saved to the app's `tests/testthat/` directory (#328).

* Package authors should now test Shiny applications within their own
`{testthat}` tests instead of using `test_app()`. This collects snapshots in a
single location using the package's existing `{testthat}` infrastructure. Use
`with_app_support()` or `local_app_support()` to load app support files as
needed. See the [use-package
vignette](https://rstudio.github.io/shinytest2/articles/use-package.html) for
more details (#328).

## Bug fixes and minor improvements

* `AppDriver$expect_values()` now works correctly with `{testthat}` v3.3.0,
which changed expectation behavior for screenshot snapshots (#418).

* `record_test()` now only saves the setup file for local app testing and not
within package app testing. When recording a test for an app inside a package,
`local_app_support()` is added to the top of the testing code. If the current
working directory is within a package and `record_in_package = TRUE`
(default), the test file is saved to the package's `tests/testthat/`
directory. If `record_in_package = FALSE`, the test file is saved relative to
the app's `tests/testthat/` directory (#328).

* Migrated from `{httr}` to `{httr2}` for all HTTP requests made by
`{shinytest2}` (#420, #428).

* `record_test()` gained a new parameter `record_in_package=`. If `TRUE` and if the current working directory is within a package, the test file will be saved to the package's `tests/testthat/` directory. If `FALSE`, the test file will be saved to the app's `tests/testthat/` directory (#328).

# shinytest2 0.4.1

Expand Down
23 changes: 13 additions & 10 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
## CRAN comments

#### 2025-04-11
#### 2026-01-11

Critical bug to user interface fixed.
Critical bug reported from testthat v3.3.0 update.

I am sorry for the fast turn around.
Larger features / bug fixes for the package.

- Barret


## R CMD check results

0 errors | 0 warnings | 1 note
0 errors | 0 warnings | 0 notes

* checking CRAN incoming feasibility ... [11s] NOTE
Maintainer: 'Barret Schloerke <barret@posit.co>'

Days since last update: 1

## revdepcheck results

We checked 54 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.
We checked 76 reverse dependencies (69 from CRAN + 7 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package.

* We saw 0 new problems
* We failed to check 0 packages
* We failed to check 2 packages

Issues with CRAN packages are summarised below.

### Failed to check

* blockr.dag (NA)
* shiny.destroy (NA)
96 changes: 96 additions & 0 deletions revdep/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,98 @@
# Platform

|field |value |
|:--------|:----------------------------------------|
|version |R version 4.5.2 (2025-10-31) |
|os |macOS Tahoe 26.2 |
|system |aarch64, darwin20 |
|ui |X11 |
|language |(EN) |
|collate |C.UTF-8 |
|ctype |C.UTF-8 |
|tz |America/New_York |
|date |2026-01-09 |
|pandoc |3.1 @ /opt/homebrew/bin/pandoc |
|quarto |1.8.25 @ /Applications/quarto/bin/quarto |

# Dependencies

|package |old |new |Δ |
|:-----------|:--------|:--------|:--|
|shinytest2 |0.4.1 |0.5.0 |* |
|AsioHeaders |1.30.2-1 |1.30.2-1 | |
|askpass |1.2.1 |1.2.1 | |
|backports |1.5.0 |1.5.0 | |
|base64enc |0.1-3 |0.1-3 | |
|brio |1.1.5 |1.1.5 | |
|bslib |0.9.0 |0.9.0 | |
|cachem |1.1.0 |1.1.0 | |
|callr |3.7.6 |3.7.6 | |
|checkmate |2.3.3 |2.3.3 | |
|chromote |0.5.1 |0.5.1 | |
|cli |3.6.5 |3.6.5 | |
|commonmark |2.0.0 |2.0.0 | |
|cpp11 |0.5.2 |0.5.2 | |
|crayon |1.5.3 |1.5.3 | |
|curl |7.0.0 |7.0.0 | |
|desc |1.4.3 |1.4.3 | |
|diffobj |0.3.6 |0.3.6 | |
|digest |0.6.39 |0.6.39 | |
|evaluate |1.0.5 |1.0.5 | |
|fastmap |1.2.0 |1.2.0 | |
|fontawesome |0.5.3 |0.5.3 | |
|fs |1.6.6 |1.6.6 | |
|globals |0.18.0 |0.18.0 | |
|glue |1.8.0 |1.8.0 | |
|highr |0.11 |0.11 | |
|htmltools |0.5.9 |0.5.9 | |
|httpuv |1.6.16 |1.6.16 | |
|httr |1.4.7 |NA |* |
|httr2 |NA |1.2.2 |* |
|jquerylib |0.1.4 |0.1.4 | |
|jsonlite |2.0.0 |2.0.0 | |
|knitr |1.51 |1.51 | |
|later |1.4.4 |1.4.5 |* |
|lifecycle |1.0.4 |1.0.5 |* |
|magrittr |2.0.4 |2.0.4 | |
|memoise |2.0.1 |2.0.1 | |
|mime |0.13 |0.13 | |
|openssl |2.3.4 |2.3.4 | |
|otel |0.2.0 |0.2.0 | |
|pingr |2.0.5 |2.0.5 | |
|pkgbuild |1.4.8 |1.4.8 | |
|pkgload |1.4.1 |1.4.1 | |
|praise |1.0.0 |1.0.0 | |
|processx |3.8.6 |3.8.6 | |
|promises |1.5.0 |1.5.0 | |
|ps |1.9.1 |1.9.1 | |
|R6 |2.6.1 |2.6.1 | |
|rappdirs |0.3.3 |0.3.3 | |
|Rcpp |1.1.0 |1.1.0 | |
|rlang |1.1.6 |1.1.6 | |
|rmarkdown |2.30 |2.30 | |
|rprojroot |2.1.1 |2.1.1 | |
|sass |0.4.10 |0.4.10 | |
|shiny |1.12.1 |1.12.1 | |
|sourcetools |0.1.7-1 |0.1.7-1 | |
|sys |3.4.3 |3.4.3 | |
|testthat |3.3.1 |3.3.1 | |
|tinytex |0.58 |0.58 | |
|vctrs |NA |0.6.5 |* |
|waldo |0.6.2 |0.6.2 | |
|websocket |1.4.4 |1.4.4 | |
|withr |3.0.2 |3.0.2 | |
|xfun |0.55 |0.55 | |
|xtable |1.8-4 |1.8-4 | |
|yaml |2.3.12 |2.3.12 | |
|zip |2.3.3 |2.3.3 | |

# Revdeps

## Failed to check (3)

|package |version |error |warning |note |
|:-------------|:-------|:-----|:-------|:----|
|blockr.dag |0.1.0 |1 | | |
|scRNAseqApp |1.10.0 |1 | | |
|shiny.destroy |0.1.0 |1 | |1 |

10 changes: 8 additions & 2 deletions revdep/cran.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
## revdepcheck results

We checked 54 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.
We checked 76 reverse dependencies (69 from CRAN + 7 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package.

* We saw 0 new problems
* We failed to check 0 packages
* We failed to check 2 packages

Issues with CRAN packages are summarised below.

### Failed to check

* blockr.dag (NA)
* shiny.destroy (NA)
66 changes: 65 additions & 1 deletion revdep/failures.md
Original file line number Diff line number Diff line change
@@ -1 +1,65 @@
*Wow, no problems at all. :)*
# blockr.dag

<details>

* Version: 0.1.0
* GitHub: NA
* Source code: https://github.com/cran/blockr.dag
* Date/Publication: 2025-12-18 13:50:02 UTC
* Number of recursive dependencies: 98

Run `revdepcheck::revdep_details(, "blockr.dag")` for more info

</details>

## In both

* R CMD check timed out


# scRNAseqApp

<details>

* Version: 1.10.0
* GitHub: https://github.com/jianhong/scRNAseqApp
* Source code: https://github.com/cran/scRNAseqApp
* Date/Publication: 2025-10-29
* Number of recursive dependencies: 244

Run `revdepcheck::revdep_details(, "scRNAseqApp")` for more info

</details>

## In both

* R CMD check timed out


# shiny.destroy

<details>

* Version: 0.1.0
* GitHub: NA
* Source code: https://github.com/cran/shiny.destroy
* Date/Publication: 2024-09-17 12:30:02 UTC
* Number of recursive dependencies: 71

Run `revdepcheck::revdep_details(, "shiny.destroy")` for more info

</details>

## In both

* R CMD check timed out


* checking DESCRIPTION meta-information ... NOTE
```
Missing dependency on R >= 4.1.0 because package code uses the pipe
|> or function shorthand \(...) syntax added in R 4.1.0.
File(s) using such syntax:
‘destroyModule.R’ ‘makeModule.R’
```

1 change: 1 addition & 0 deletions tests/testthat/test-app-screenshot-size.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ library(shiny)

test_that("images are captured via expect_values", {
skip_on_cran()
skip_on_os("windows")
skip_if_not_installed("png")

img_height <- 501
Expand Down
5 changes: 5 additions & 0 deletions tests/testthat/test-spelling.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ test_that("Spell check", {
skip_on_ci()
skip_if_not_installed("spelling")

desc_file <- file.path(test_path("../../"), "DESCRIPTION")
if (!file.exists(desc_file)) {
skip("No DESCRIPTION file found")
}

spelling_errors <- spelling::spell_check_package(test_path("../../"))
if (nrow(spelling_errors) > 0) {
res_print <-
Expand Down
Loading