Skip to content

Commit 962aa6d

Browse files
committed
Small tweaks
1 parent 4732af5 commit 962aa6d

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

R/active.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ find_test_file <- function(path, call = parent.frame()) {
3737

3838
test_file_type <- function(path) {
3939
dir <- path_file(path_dir(path))
40+
# this accounts for snapshot files in a variant subfolder
4041
parent_dir <- path_file(path_dir(path_dir(path)))
4142
name <- path_file(path)
4243
ext <- tolower(path_ext(path))

tests/testthat/test-active.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ test_that("fails if can't find tests", {
1515
test_that("find_test_file() works with snapshot files", {
1616
dir <- local_package_create()
1717
withr::local_dir(dir)
18+
1819
dir_create("tests/testthat/_snaps")
1920
file_create("tests/testthat/test-foo.R")
2021
file_create("tests/testthat/_snaps/foo.md")
@@ -25,8 +26,8 @@ test_that("find_test_file() works with snapshot files", {
2526

2627
test_that("find_test_file() works with snapshot variant files", {
2728
dir <- local_package_create()
28-
2929
withr::local_dir(dir)
30+
3031
dir_create("tests/testthat/_snaps/variant")
3132
file_create("tests/testthat/test-foo.R")
3233
file_create("tests/testthat/_snaps/variant/foo.md")

0 commit comments

Comments
 (0)