Skip to content

Commit

Permalink
Make test less sensitive to local conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
jennybc committed Mar 1, 2024
1 parent b2805d2 commit c462abf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tests/testthat/_snaps/utils-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,9 @@
Message
* Key: something great
Code
kv_line("Interesting file", I("{.path {git_ignore_path('user')}}"))
kv_line("Interesting file", I("{.url {url}}"))
Message
* Interesting file: '~/.gitignore_global'
* Interesting file: <https://usethis.r-lib.org/>

# kv_line() can treat value in different ways [fancy]

Expand Down Expand Up @@ -449,7 +449,7 @@
Message
• Key: something great
Code
kv_line("Interesting file", I("{.path {git_ignore_path('user')}}"))
kv_line("Interesting file", I("{.url {url}}"))
Message
• Interesting file: [34m~/.gitignore_global[39m
• Interesting file: [3m[34m<https://usethis.r-lib.org/>[39m[23m

3 changes: 2 additions & 1 deletion tests/testthat/test-utils-ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ cli::test_that_cli("kv_line() can treat value in different ways", {

value <- "some value"
adjective <- "great"
url <- "https://usethis.r-lib.org/"

expect_snapshot({
# evaluation in .envir
Expand All @@ -225,6 +226,6 @@ cli::test_that_cli("kv_line() can treat value in different ways", {
# I() indicates value has markup
kv_line("Key", I("something {.emph important}"))
kv_line("Key", I("something {.emph {adjective}}"))
kv_line("Interesting file", I("{.path {git_ignore_path('user')}}"))
kv_line("Interesting file", I("{.url {url}}"))
})
}, configs = c("plain", "fancy"))

0 comments on commit c462abf

Please sign in to comment.