Skip to content

Commit

Permalink
-Update snapshot tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tylermorganwall committed Mar 31, 2024
1 parent bae907d commit 222b281
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Binary file not shown.
Binary file added tests/testthat/_snaps/rayshader/rayshader.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 11 additions & 7 deletions tests/testthat/test-rayshader.R
Expand Up @@ -8,11 +8,15 @@ compare_image = function(path1, path2) {
test_that("rayshader tests", {
set.seed(1)

volcano %>%
rayshader::sphere_shade() %>%
rayshader::plot_3d(volcano,zscale = 2)
temp_hq = tempfile(fileext = ".png")
rayshader::render_highquality(filename=temp_hq, samples = 100)
rgl::close3d()
expect_snapshot_file(temp_hq, compare = compare_image)
testthat::expect_no_error({
volcano %>%
rayshader::sphere_shade() %>%
rayshader::plot_3d(volcano,zscale = 2)
temp_hq = tempfile(fileext = ".png")
rayshader::render_highquality(filename=temp_hq, samples = 100)
rgl::close3d()
})

announce_snapshot_file(temp_hq, name = "rayshader.png")
expect_snapshot_file(temp_hq, name = "rayshader.png", compare = compare_image)
})

0 comments on commit 222b281

Please sign in to comment.