tests/testthat/test-config.R

require(testthat)

test_that('Configuration fails', {
  expect_error(config('hello'))
  expect_error(config(connectionString='hello', appId="hello"))
  expect_error(config(connectionString='InstrumentationKey=hello', appId="hello"))
  config(connectionString="InstrumentationKey=abc;IngestionEndpoint=abc", appId="hello")
  expect_error(
    config(connectionString="InstrumentationKey=abc;IngestionEndpoint=abc", appId=123),
    regexp = "rlang::is_string(x = appId) is not TRUE", fixed=TRUE
  )

})

Try the AzureAppInsights package in your browser

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

AzureAppInsights documentation built on July 9, 2023, 7:23 p.m.