tests/testthat/test-warnings-errors.R

context("Warnings and errors")

with_mock_api({
  test_that("Incorrect API types are caught", {
    expect_warning(clquery(type = "junk"))
  })
})

with_mock_api({
  test_that("Incorrect formats are caught", {
    expect_warning(clquery('color', '6B4106', fmt = 'junk'))
  })
})

Try the colourlovers package in your browser

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

colourlovers documentation built on Jan. 13, 2021, 11:52 a.m.