Skip to content

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

@gadenbuie

Description

@gadenbuie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions