tests/testthat/test_mindat_ima_minerals.R

library(httr)
library(jsonlite)
#You should apply for and get your own token from Mindat.org.
This_is_a_temporary_token = "321e35e57066ccb129a9d9af7ffe1958"
expect_no_error(mindat_connection(This_is_a_temporary_token,page_size = 1500))

# test_that("Test minerals_ima_list function", {
#   expect_no_error(df <- minerals_ima_list())
#   expect_equal(typeof(df), "list")
# })

# test_that("Test minerals_ima_list_expand function", {
#   expect_no_error(df <- minerals_ima_list_expand("~all"))
#   expect_equal(typeof(df), "list")
# })

test_that("Test minerals_ima_list_ima function", {
  expect_no_error(df <- minerals_ima_list_ima(1))
  expect_equal(typeof(df), "list")
})


# test_that("Test minerals_ima_updated_at function", {
#   expect_no_error(df <- minerals_ima_updated_at("2022-03-09 01:13:59"))
#   expect_equal(typeof(df), "list")
# })

test_that("Test minerals_ima_retrieve function", {
  expect_no_error(df <- minerals_ima_retrieve(id =1))
  expect_equal(typeof(df), "list")
})

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.