|
| 1 | +# don't run on CRAN - this require installed Quarto version with the right version of the quarto package. |
| 2 | +skip_on_cran() |
| 3 | +skip_if_no_quarto() |
| 4 | +skip_if_not_installed("withr") |
| 5 | + |
| 6 | +# We need to install the package in a temporary library when we are in dev mode |
| 7 | +install_dev_package() |
1 | 8 |
|
2 | 9 | test_that("render flextable", { |
3 | | - skip_if_no_quarto() |
4 | | - quarto_render("theme/flextable.qmd", quiet = TRUE) |
5 | | - expect_true(file.exists("theme/flextable.html")) |
6 | | - unlink("theme/flextable.html") |
| 10 | + .render(test_path("theme/flextable.qmd")) |
7 | 11 | }) |
8 | 12 |
|
9 | | - |
10 | 13 | test_that("render ggiraph", { |
11 | | - skip_if_no_quarto() |
12 | | - quarto_render("theme/ggiraph.qmd", quiet = TRUE) |
13 | | - expect_true(file.exists("theme/ggiraph.html")) |
14 | | - unlink("theme/ggiraph.html") |
| 14 | + .render(test_path("theme/ggiraph.qmd")) |
15 | 15 | }) |
16 | 16 |
|
17 | | - |
18 | 17 | test_that("render ggplot", { |
19 | | - skip_if_no_quarto() |
20 | | - quarto_render("theme/ggplot.qmd", quiet = TRUE) |
21 | | - expect_true(file.exists("theme/ggplot.html")) |
22 | | - unlink("theme/ggplot.html") |
| 18 | + .render(test_path("theme/ggplot.qmd")) |
23 | 19 | }) |
24 | 20 |
|
25 | | - |
26 | 21 | test_that("render gt", { |
27 | | - skip_if_no_quarto() |
28 | | - quarto_render("theme/gt.qmd", quiet = TRUE) |
29 | | - expect_true(file.exists("theme/gt.html")) |
30 | | - unlink("theme/gt.html") |
| 22 | + .render(test_path("theme/gt.qmd")) |
31 | 23 | }) |
32 | 24 |
|
33 | | - |
34 | 25 | test_that("render plotly-r", { |
35 | | - skip_if_no_quarto() |
36 | | - quarto_render("theme/plotly-r.qmd", quiet = TRUE) |
37 | | - expect_true(file.exists("theme/plotly-r.html")) |
38 | | - unlink("theme/plotly-r.html") |
| 26 | + .render(test_path("theme/plotly-r.qmd")) |
39 | 27 | }) |
40 | 28 |
|
41 | | - |
42 | 29 | test_that("render thematic", { |
43 | | - skip_if_no_quarto() |
44 | | - quarto_render("theme/thematic.qmd", quiet = TRUE) |
45 | | - expect_true(file.exists("theme/thematic.html")) |
46 | | - unlink("theme/thematic.html") |
| 30 | + .render(test_path("theme/thematic.qmd")) |
47 | 31 | }) |
48 | | - |
0 commit comments