Description Usage Arguments Details Value Examples
View source: R/utils-testthat-helpers.R
This wrapper of skip_if_not() to skip tests if stock db is not available for testing.
1 | skip_if_stock_db_not_ready(dsn = "GTA_SQLData")
|
dsn |
A string of DSN to connected. Default value "GTA_SQLData". |
You could simulate a environment without stock db by setting environment variable "NO_STOCK_DB" to "true".
No return value
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
# Skip tests when stock db is unavailable in the test file
skip_if_stock_db_not_ready()
test_that("tests related to stock db", {
expect_equal(1, 3) #'
})
# Run Tests in a simulated environment without stock db
withr::with_envvar(
new = c("NO_STOCK_DB" = "true"),
devtools::test() # test package
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.