-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Have
renderPlot()
error early if height/width of a plot aren't yet …
…defined (#3739) * Close #3704. Close #3735. Close #1409. Throw informative error in renderPlot() early if height/width of a plot aren't yet defined * `devtools::document()` (GitHub Actions) * Add unit tests * Use consistent filename; add intentional failure (to get artifact uploads) * Make output id argument name more unique * Update news * plotPNG() test isn't worth it * Don't try to provide a suggestion on how to fix the issue (it's no worse than what we currently have, and we probably should be defaulting to an 'arbitrary' size anyway * update news * minimize diff Co-authored-by: cpsievert <cpsievert@users.noreply.github.com>
- Loading branch information
Showing
4 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
test_that("startPNG() throws informative error", { | ||
tmp <- tempfile(fileext = '.png') | ||
|
||
expect_error( | ||
startPNG( | ||
filename = tmp, | ||
width = NULL, | ||
height = 100, | ||
res = 72 | ||
), | ||
"Invalid plot `width`." | ||
) | ||
|
||
expect_error( | ||
startPNG( | ||
filename = tmp, | ||
width = 100, | ||
height = NULL, | ||
res = 72 | ||
), | ||
"Invalid plot `height`." | ||
) | ||
}) |