tests/testthat/test-reprex_document.R

test_that("upload.fun responds to venue", {
  x <- reprex_document(venue = "gh")
  expect_identical(x$knitr$opts_knit$upload.fun, knitr::imgur_upload)
  x <- reprex_document(venue = "r")
  expect_identical(x$knitr$opts_knit$upload.fun, identity)
})

test_that("ad responds to venue", {
  expect_snapshot(ad("gh"))
  expect_snapshot(ad("slack"))
  expect_snapshot(ad("r"))
})

Try the reprex package in your browser

Any scripts or data that you put into this service are public.

reprex documentation built on Aug. 17, 2022, 9:07 a.m.