Nothing
test_that("notion_client() creates a valid client", {
notion <- notion_client()
expect_r6_class(notion, "NotionClient")
expect_s3_class(notion$request(), "httr2_request")
expect_match(
notion[["base_url"]],
"api\\.notion\\.com"
)
expect_match(
notion[["version"]],
"\\d{4}-\\d{2}-\\d{2}"
)
})
test_that("Client creation fails without authentication", {
token <- Sys.getenv("NOTION_TOKEN")
on.exit(Sys.setenv(NOTION_TOKEN = token))
Sys.unsetenv("NOTION_TOKEN")
expect_error(
notion_client(auth = ""),
class = "notionapi_auth_error"
)
})
test_that("async_notion_client creates AsyncNotionClient", {
async_notion <- async_notion_client()
expect_r6_class(async_notion, "AsyncNotionClient")
expect_r6_class(async_notion, "NotionClient") # test inheritance
})
test_that("Async methods return promises", {
async_notion <- async_notion_client()
vcr::local_cassette("notion-users-list")
p <- async_notion$users$list()
expect_true(
promises::is.promise(p)
)
})
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.