Skip to content

Commit

Permalink
tests: run tests on temp directory
Browse files Browse the repository at this point in the history
  • Loading branch information
luciorq committed Dec 5, 2024
1 parent 2dcb1c5 commit 902ce59
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,17 @@ withr::local_options(
),
.local_envir = testthat::teardown_env()
)

# fs::path(local_temp_dir, "home")
# fs::path_temp("tmp", "home", "data")

withr::local_envvar(
.new = list(
`HOME` = fs::path_temp("tmp", "home"),
`USERPROFILE` = fs::path_temp("tmp", "home"),
`LOCALAPPDATA` = fs::path_temp("tmp", "home", "data"),
`APPDATA` = fs::path_temp("tmp", "home", "data"),
`R_USER_DATA_DIR` = fs::path_temp("tmp", "home", "data"),
`XDG_DATA_HOME` = fs::path_temp("tmp", "home", "data")
)
)

0 comments on commit 902ce59

Please sign in to comment.