tests/testthat/test_OpenMindat.R

#You should apply for and get your own token from Mindat.org.
This_is_a_temporary_token = "9ce67655d74bcd981e937be80dcea9cb"

test_that("Initializing Mindat API with only token", {
  expect_no_error(mindat_connection(This_is_a_temporary_token))
  expect_no_error(mindat_connection(This_is_a_temporary_token,page_size = 1500))
})

test_that("Initializing Mindat API with token and base_uri", {
  expect_no_error(mindat_connection(This_is_a_temporary_token,"https://api.mindat.org/v1"))
})

test_that("Initializing Mindat API with token, base_uri ,and fmt", {
  expect_no_error(mindat_connection(This_is_a_temporary_token,"https://api.mindat.org/v1","json"))
})

Try the OpenMindat package in your browser

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

OpenMindat documentation built on June 8, 2025, 1:47 p.m.