tests/testthat/test-warnings.R

context("Warnings")

test_that("warnings are suppressed", {
    expect_silent(fromJSONstat("nonexistent.json", silent = TRUE))
})

test_that("warnings work", {
    expect_warning(fromJSONstat("nonexistent.json"), "returning unparsed list",
                   all = TRUE)
})

Try the rjstat package in your browser

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

rjstat documentation built on Sept. 8, 2023, 5:10 p.m.