tests/testthat/test-snippet.R

test_that("snippet returns error when outside RStudio or no opened file", {
  skip_if_not(interactive())
  skip_if_not(is.null(tryCatch(rstudioapi::getSourceEditorContext()$id, error = function() NULL)))
  expect_error(snippet(), "Can't find opened file in RStudio.", fixed = TRUE)
})
gsmolinski/shinybreakpoint documentation built on Jan. 13, 2023, 12:48 a.m.