file <- tempfile(fileext = ".html")
html <- paste0("hello",
"Hello World\n")
cat(html, file = file)
if (FALSE) {
if (require("tinytest") && require("webshot2")){
# first run add a new snapshot
expect_snapshot_html(x = file, name = "html file",
engine = "tinytest")
# next runs compare with the snapshot
expect_snapshot_html(x = file, name = "html file",
engine = "tinytest")
# cleaning directory
unlink("_tinytest_doconv", recursive = TRUE,
force = TRUE)
}
if (require("testthat") && require("webshot2")){
local_edition(3)
# first run add a new snapshot
expect_snapshot_html(x = file, name = "html file",
engine = "testthat")
# next runs compare with the snapshot
expect_snapshot_html(x = file, name = "html file",
engine = "testthat")
}
}
Run the code above in your browser using DataLab