Nothing
# Tests for helpful error messages
test_that("error messages are informative", {
expect_error(
fetch_nomis(),
"Dataset ID required"
)
expect_error(
get_codes(),
"Dataset ID.*required"
)
expect_error(
aggregate_geography(data.frame(x = 1), "TYPE", "missing"),
"not found"
)
})
test_that("missing package errors suggest installation", {
# Use skip_if_not_installed (reverse logic)
skip_if_not_installed("rsdmx")
# If rsdmx IS installed, we can't test the error message
# So we skip this test when rsdmx is available
skip("rsdmx is installed, cannot test error message")
})
# Alternative test that works regardless
test_that("missing package errors are handled", {
# Test that functions check for required packages
# This will pass whether or not rsdmx is installed
if (!requireNamespace("rsdmx", quietly = TRUE)) {
expect_error(
lookup_geography("London"),
"rsdmx.*required|install"
)
} else {
# If rsdmx is installed, just verify function exists
expect_true(exists("lookup_geography"))
}
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.