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

Upkeep: Standardize test file names to avoid "mytest" and "migrated shinytest" names #208

Open
gadenbuie opened this issue Aug 2, 2023 · 0 comments

Comments

@gadenbuie
Copy link
Member

gadenbuie commented Aug 2, 2023

There's enough tooling around tests that this isn't a blocker, but I find the "mytest" context a bit weird in our tests. I'd much rather we have test-026-shiny-inline.R than test-mytest.R in inst/apps/026-shiny-inline/tests/testthat/.

Running tests for app: 026-shiny-inline

Loading required package: shiny
Loading required package: testthat
✔ | F W S  OK | Context

⠏ |         0 | mytest                                                          
⠋ | 1       0 | mytest                                                          
⠙ | 1       1 | mytest                                                          
⠹ | 2       1 | mytest                                                          
⠸ | 2       2 | mytest                                                          
⠼ | 3       2 | mytest                                                          
⠴ | 3       3 | mytest                                                          
✖ | 3       3 | mytest [7.1s]
────────────────────────────────────────────────────────────────────────────────
Failure ('test-mytest.R:13:3'): Migrated shinytest test: mytest.R
Snapshot of `file` to 'mytest/001.json' has changed
Run `testthat::snapshot_review('mytest/')` to review changes
Backtrace:
    ▆
 1. └─app$expect_values() at test-mytest.R:13:2
 2.   └─shinytest2:::app_expect_values(...)
 3.     └─shinytest2:::app__expect_snapshot_file(...)
 4.       ├─base::withCallingHandlers(...)
 5.       └─testthat::expect_snapshot_file(...)

One small advantage is that it'd be (marginally) easier to open the test files, e.g. test-026... to jump into the test file.

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

No branches or pull requests

1 participant