Skip to content

Commit 6743479

Browse files
committed
demote warning to message
1 parent a15f1ac commit 6743479

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

R/labels.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ setup_plot_labels <- function(plot, layers, data) {
9292
extra_labels <- paste0("{.field ", extra_labels, "} : ", warn_labels)
9393
names(extra_labels) <- rep("*", length(extra_labels))
9494

95-
cli::cli_warn(c(
95+
cli::cli_inform(c(
9696
"Ignoring unknown labels:",
9797
extra_labels
9898
))

tests/testthat/_snaps/labels.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@
1414

1515
# warnings are thrown for unknown labels
1616

17-
Ignoring unknown labels:
18-
* foo : "i don't exist"
19-
* bar : <function>
20-
* qux : "expression(me * neither)"
17+
Code
18+
p <- ggplot_build(p)
19+
Message
20+
Ignoring unknown labels:
21+
* foo : "i don't exist"
22+
* bar : <function>
23+
* qux : "expression(me * neither)"
2124

2225
# plot.tag.position rejects invalid input
2326

tests/testthat/test-labels.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ test_that("warnings are thrown for unknown labels", {
117117
bar = function(x) "i don't exist either",
118118
qux = expression(me * neither)
119119
)
120-
expect_snapshot_warning(ggplot_build(p))
120+
expect_snapshot(p <- ggplot_build(p))
121121
})
122122

123123
test_that("plot.tag.position rejects invalid input", {

0 commit comments

Comments
 (0)