Skip to content

Commit

Permalink
Return UTC when run in testing env and add snapshots to reflect it
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksanderbl29 committed Sep 2, 2024
1 parent 9ed2ac5 commit 1b63f83
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion R/get_map_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ get_map_data <- function(type) {

tz <- Sys.getenv("TZ")

if (tz == "") {
if (testthat::is_testing() | testthat::is_snapshot() | testthat::is_checking()) {
Sys.setenv(TZ = "UTC")
} else if (tz == "") {
Sys.setenv(TZ = "Europe/Copenhagen")
}

Expand Down
20 changes: 10 additions & 10 deletions tests/testthat/_snaps/get_map_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,16 @@
9 1 København A Hovedstaden
10 1 København A Hovedstaden
ændret geo_ændret geo_version visueltcenter_x
1 2024-04-24 23:01:20 2024-04-24 23:01:20 8 12.57518
2 2024-04-24 23:01:20 2024-04-24 23:01:20 6 12.58267
3 2024-04-24 23:01:20 2024-04-24 23:01:20 6 12.56874
4 2024-04-24 23:01:20 2024-04-24 23:01:20 7 12.56014
5 2024-04-24 23:01:20 2024-04-24 23:01:20 7 12.56856
6 2024-04-24 23:01:20 2024-04-24 23:01:20 6 12.60509
7 2024-04-24 23:01:20 2024-04-24 23:01:20 6 12.59872
8 2024-04-24 23:01:20 2024-04-24 23:01:20 7 12.56478
9 2024-04-29 23:01:24 2024-04-24 23:01:20 8 12.56800
10 2024-05-07 23:01:19 2024-04-24 23:01:20 9 12.56671
1 2024-04-24 21:01:20 2024-04-24 21:01:20 8 12.57518
2 2024-04-24 21:01:20 2024-04-24 21:01:20 6 12.58267
3 2024-04-24 21:01:20 2024-04-24 21:01:20 6 12.56874
4 2024-04-24 21:01:20 2024-04-24 21:01:20 7 12.56014
5 2024-04-24 21:01:20 2024-04-24 21:01:20 7 12.56856
6 2024-04-24 21:01:20 2024-04-24 21:01:20 6 12.60509
7 2024-04-24 21:01:20 2024-04-24 21:01:20 6 12.59872
8 2024-04-24 21:01:20 2024-04-24 21:01:20 7 12.56478
9 2024-04-29 21:01:24 2024-04-24 21:01:20 8 12.56800
10 2024-05-07 21:01:19 2024-04-24 21:01:20 9 12.56671
visueltcenter_y geometry
1 55.70476 MULTIPOLYGON (((12.56228 55...
2 55.71087 MULTIPOLYGON (((12.56579 55...
Expand Down

0 comments on commit 1b63f83

Please sign in to comment.