Skip to content

Commit f4faefe

Browse files
authored
v0.5.0 (#426)
1 parent 3b374cb commit f4faefe

File tree

8 files changed

+247
-40
lines changed

8 files changed

+247
-40
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: shinytest2
22
Title: Testing for Shiny Applications
3-
Version: 0.4.1.9002
3+
Version: 0.5.0
44
Authors@R: c(
55
person("Barret", "Schloerke", , "barret@posit.co", role = c("cre", "aut"),
66
comment = c(ORCID = "0000-0001-9986-114X")),

NEWS.md

Lines changed: 58 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,67 @@
1-
# shinytest2 (development version)
1+
# shinytest2 0.5.0
22

3+
## Lifecycle changes
34

4-
## AppDriver
5+
* `load_app_env()` has been superseded by `load_app_support()`. This new
6+
function aligns its name with `local_app_support()` and
7+
`with_app_support()`, and similarly, it requires an `app_dir` parameter
8+
(#328).
59

6-
* 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).
10+
* `test_app(check_setup=)` is now deprecated. Checking is no longer required
11+
as default behavior, as `load_app_env()` has been superseded by
12+
`with_app_support()` and `local_app_support()`, which provide a more robust
13+
and flexible way to scope app support files such as `global.R`, `app.R`,
14+
`server.R`, and `ui.R` (#328).
715

8-
* 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).
9-
10-
## Package testing
11-
12-
* 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).
13-
14-
* 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).
15-
16-
## Bug / Improvements
17-
18-
* 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).
19-
20-
* `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).
21-
22-
* `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).
23-
24-
* Given `test_app(check_setup=FALSE)` is now deprecated. This change was done for package authors do not require apps to load support (#328).
25-
26-
* `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).
27-
28-
* Fixed internal bug where `{testthat}` v3.3.0 changed expectation behavior for screenshot snapshots within `App$expect_values()` (#418).
16+
## New features
2917

30-
* Migrated from `{httr}` to `{httr2}` for all HTTP requests made by `{shinytest2}` (#420, #428).
18+
* `AppDriver$new(app_dir=)` now supports local package development for the
19+
background Shiny app process. In the background test R process, any
20+
`library(<pkg>)` or `require(<pkg>)` call automatically executes
21+
`pkgload::load_all()` to load the local R package's source code. Installing
22+
the package before testing is no longer required (#402).
23+
24+
* `AppDriver$new(app_dir=)` now supports function execution. You must run the
25+
app (or document) yourself or return a Shiny app object. Similar to `{mirai}`,
26+
all packages must be loaded with `library()` or `require()` again as the
27+
function runs in the background R process (#402).
28+
29+
* Added `local_app_support()`, `with_app_support()`, and `load_app_support()`.
30+
`local_app_support()` and `with_app_support()` provide package authors a
31+
flexible way to scope app support files such as `global.R`, `app.R`,
32+
`server.R`, and `ui.R` within tests. Non-package authors should still use
33+
`load_app_support()` within their `setup-shinytest2.R` file. See
34+
`?local_app_support` for more details (#328).
35+
36+
* `record_test()` gained a `record_in_package` parameter. If `TRUE` (default)
37+
and the current working directory is within a package, the test file is saved
38+
to the package's `tests/testthat/` directory. If `FALSE`, the test file is
39+
saved to the app's `tests/testthat/` directory (#328).
40+
41+
* Package authors should now test Shiny applications within their own
42+
`{testthat}` tests instead of using `test_app()`. This collects snapshots in a
43+
single location using the package's existing `{testthat}` infrastructure. Use
44+
`with_app_support()` or `local_app_support()` to load app support files as
45+
needed. See the [use-package
46+
vignette](https://rstudio.github.io/shinytest2/articles/use-package.html) for
47+
more details (#328).
48+
49+
## Bug fixes and minor improvements
50+
51+
* `AppDriver$expect_values()` now works correctly with `{testthat}` v3.3.0,
52+
which changed expectation behavior for screenshot snapshots (#418).
53+
54+
* `record_test()` now only saves the setup file for local app testing and not
55+
within package app testing. When recording a test for an app inside a package,
56+
`local_app_support()` is added to the top of the testing code. If the current
57+
working directory is within a package and `record_in_package = TRUE`
58+
(default), the test file is saved to the package's `tests/testthat/`
59+
directory. If `record_in_package = FALSE`, the test file is saved relative to
60+
the app's `tests/testthat/` directory (#328).
61+
62+
* Migrated from `{httr}` to `{httr2}` for all HTTP requests made by
63+
`{shinytest2}` (#420, #428).
3164

32-
* `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).
3365

3466
# shinytest2 0.4.1
3567

cran-comments.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
## CRAN comments
22

3-
#### 2025-04-11
3+
#### 2026-01-11
44

5-
Critical bug to user interface fixed.
5+
Critical bug reported from testthat v3.3.0 update.
66

7-
I am sorry for the fast turn around.
7+
Larger features / bug fixes for the package.
88

99
- Barret
1010

1111

1212
## R CMD check results
1313

14-
0 errors | 0 warnings | 1 note
14+
0 errors | 0 warnings | 0 notes
1515

16-
* checking CRAN incoming feasibility ... [11s] NOTE
17-
Maintainer: 'Barret Schloerke <barret@posit.co>'
18-
19-
Days since last update: 1
2016

2117
## revdepcheck results
2218

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

2521
* We saw 0 new problems
26-
* We failed to check 0 packages
22+
* We failed to check 2 packages
23+
24+
Issues with CRAN packages are summarised below.
25+
26+
### Failed to check
27+
28+
* blockr.dag (NA)
29+
* shiny.destroy (NA)

revdep/README.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,98 @@
1+
# Platform
2+
3+
|field |value |
4+
|:--------|:----------------------------------------|
5+
|version |R version 4.5.2 (2025-10-31) |
6+
|os |macOS Tahoe 26.2 |
7+
|system |aarch64, darwin20 |
8+
|ui |X11 |
9+
|language |(EN) |
10+
|collate |C.UTF-8 |
11+
|ctype |C.UTF-8 |
12+
|tz |America/New_York |
13+
|date |2026-01-09 |
14+
|pandoc |3.1 @ /opt/homebrew/bin/pandoc |
15+
|quarto |1.8.25 @ /Applications/quarto/bin/quarto |
16+
17+
# Dependencies
18+
19+
|package |old |new |Δ |
20+
|:-----------|:--------|:--------|:--|
21+
|shinytest2 |0.4.1 |0.5.0 |* |
22+
|AsioHeaders |1.30.2-1 |1.30.2-1 | |
23+
|askpass |1.2.1 |1.2.1 | |
24+
|backports |1.5.0 |1.5.0 | |
25+
|base64enc |0.1-3 |0.1-3 | |
26+
|brio |1.1.5 |1.1.5 | |
27+
|bslib |0.9.0 |0.9.0 | |
28+
|cachem |1.1.0 |1.1.0 | |
29+
|callr |3.7.6 |3.7.6 | |
30+
|checkmate |2.3.3 |2.3.3 | |
31+
|chromote |0.5.1 |0.5.1 | |
32+
|cli |3.6.5 |3.6.5 | |
33+
|commonmark |2.0.0 |2.0.0 | |
34+
|cpp11 |0.5.2 |0.5.2 | |
35+
|crayon |1.5.3 |1.5.3 | |
36+
|curl |7.0.0 |7.0.0 | |
37+
|desc |1.4.3 |1.4.3 | |
38+
|diffobj |0.3.6 |0.3.6 | |
39+
|digest |0.6.39 |0.6.39 | |
40+
|evaluate |1.0.5 |1.0.5 | |
41+
|fastmap |1.2.0 |1.2.0 | |
42+
|fontawesome |0.5.3 |0.5.3 | |
43+
|fs |1.6.6 |1.6.6 | |
44+
|globals |0.18.0 |0.18.0 | |
45+
|glue |1.8.0 |1.8.0 | |
46+
|highr |0.11 |0.11 | |
47+
|htmltools |0.5.9 |0.5.9 | |
48+
|httpuv |1.6.16 |1.6.16 | |
49+
|httr |1.4.7 |NA |* |
50+
|httr2 |NA |1.2.2 |* |
51+
|jquerylib |0.1.4 |0.1.4 | |
52+
|jsonlite |2.0.0 |2.0.0 | |
53+
|knitr |1.51 |1.51 | |
54+
|later |1.4.4 |1.4.5 |* |
55+
|lifecycle |1.0.4 |1.0.5 |* |
56+
|magrittr |2.0.4 |2.0.4 | |
57+
|memoise |2.0.1 |2.0.1 | |
58+
|mime |0.13 |0.13 | |
59+
|openssl |2.3.4 |2.3.4 | |
60+
|otel |0.2.0 |0.2.0 | |
61+
|pingr |2.0.5 |2.0.5 | |
62+
|pkgbuild |1.4.8 |1.4.8 | |
63+
|pkgload |1.4.1 |1.4.1 | |
64+
|praise |1.0.0 |1.0.0 | |
65+
|processx |3.8.6 |3.8.6 | |
66+
|promises |1.5.0 |1.5.0 | |
67+
|ps |1.9.1 |1.9.1 | |
68+
|R6 |2.6.1 |2.6.1 | |
69+
|rappdirs |0.3.3 |0.3.3 | |
70+
|Rcpp |1.1.0 |1.1.0 | |
71+
|rlang |1.1.6 |1.1.6 | |
72+
|rmarkdown |2.30 |2.30 | |
73+
|rprojroot |2.1.1 |2.1.1 | |
74+
|sass |0.4.10 |0.4.10 | |
75+
|shiny |1.12.1 |1.12.1 | |
76+
|sourcetools |0.1.7-1 |0.1.7-1 | |
77+
|sys |3.4.3 |3.4.3 | |
78+
|testthat |3.3.1 |3.3.1 | |
79+
|tinytex |0.58 |0.58 | |
80+
|vctrs |NA |0.6.5 |* |
81+
|waldo |0.6.2 |0.6.2 | |
82+
|websocket |1.4.4 |1.4.4 | |
83+
|withr |3.0.2 |3.0.2 | |
84+
|xfun |0.55 |0.55 | |
85+
|xtable |1.8-4 |1.8-4 | |
86+
|yaml |2.3.12 |2.3.12 | |
87+
|zip |2.3.3 |2.3.3 | |
88+
189
# Revdeps
290

91+
## Failed to check (3)
92+
93+
|package |version |error |warning |note |
94+
|:-------------|:-------|:-----|:-------|:----|
95+
|blockr.dag |0.1.0 |1 | | |
96+
|scRNAseqApp |1.10.0 |1 | | |
97+
|shiny.destroy |0.1.0 |1 | |1 |
98+

revdep/cran.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
## revdepcheck results
22

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

55
* We saw 0 new problems
6-
* We failed to check 0 packages
6+
* We failed to check 2 packages
77

8+
Issues with CRAN packages are summarised below.
9+
10+
### Failed to check
11+
12+
* blockr.dag (NA)
13+
* shiny.destroy (NA)

revdep/failures.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,65 @@
1-
*Wow, no problems at all. :)*
1+
# blockr.dag
2+
3+
<details>
4+
5+
* Version: 0.1.0
6+
* GitHub: NA
7+
* Source code: https://github.com/cran/blockr.dag
8+
* Date/Publication: 2025-12-18 13:50:02 UTC
9+
* Number of recursive dependencies: 98
10+
11+
Run `revdepcheck::revdep_details(, "blockr.dag")` for more info
12+
13+
</details>
14+
15+
## In both
16+
17+
* R CMD check timed out
18+
19+
20+
# scRNAseqApp
21+
22+
<details>
23+
24+
* Version: 1.10.0
25+
* GitHub: https://github.com/jianhong/scRNAseqApp
26+
* Source code: https://github.com/cran/scRNAseqApp
27+
* Date/Publication: 2025-10-29
28+
* Number of recursive dependencies: 244
29+
30+
Run `revdepcheck::revdep_details(, "scRNAseqApp")` for more info
31+
32+
</details>
33+
34+
## In both
35+
36+
* R CMD check timed out
37+
38+
39+
# shiny.destroy
40+
41+
<details>
42+
43+
* Version: 0.1.0
44+
* GitHub: NA
45+
* Source code: https://github.com/cran/shiny.destroy
46+
* Date/Publication: 2024-09-17 12:30:02 UTC
47+
* Number of recursive dependencies: 71
48+
49+
Run `revdepcheck::revdep_details(, "shiny.destroy")` for more info
50+
51+
</details>
52+
53+
## In both
54+
55+
* R CMD check timed out
56+
57+
58+
* checking DESCRIPTION meta-information ... NOTE
59+
```
60+
Missing dependency on R >= 4.1.0 because package code uses the pipe
61+
|> or function shorthand \(...) syntax added in R 4.1.0.
62+
File(s) using such syntax:
63+
‘destroyModule.R’ ‘makeModule.R’
64+
```
65+

tests/testthat/test-app-screenshot-size.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ library(shiny)
33

44
test_that("images are captured via expect_values", {
55
skip_on_cran()
6+
skip_on_os("windows")
67
skip_if_not_installed("png")
78

89
img_height <- 501

tests/testthat/test-spelling.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ test_that("Spell check", {
33
skip_on_ci()
44
skip_if_not_installed("spelling")
55

6+
desc_file <- file.path(test_path("../../"), "DESCRIPTION")
7+
if (!file.exists(desc_file)) {
8+
skip("No DESCRIPTION file found")
9+
}
10+
611
spelling_errors <- spelling::spell_check_package(test_path("../../"))
712
if (nrow(spelling_errors) > 0) {
813
res_print <-

0 commit comments

Comments
 (0)