tests/tinytest.R

# Run by default, including on CRAN. Set RUN_TESTS=false to opt out locally.
# Tests are skipped when the suggested package tinytest is unavailable.

run_tests <- tolower(Sys.getenv("RUN_TESTS", "true")) %in%
  c("true", "t", "1", "yes", "y")

if (run_tests) {
  if (requireNamespace("tinytest", quietly = TRUE)) {
    tinytest::test_package("sanic")
  } else {
    message("Skipping tests: package 'tinytest' is not installed.")
  }
} else {
  message("Skipping tests: RUN_TESTS is disabled.")
}

Try the sanic package in your browser

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

sanic documentation built on Oct. 25, 2026, 5:06 p.m.