tests/testthat/test-utils-entity.R

test_that(".validate_entity works", {
  # create entity with numeric @id
  expect_no_error({
    rocrateR::entity(
      id = 123456,
      type = "Dataset"
    )
  })

  # create RO-Crate with entity missing @type
  incomplete_entity <- list(`@id` = 123456)
  expect_error(rocrateR::rocrate(incomplete_entity))
})

Try the rocrateR package in your browser

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

rocrateR documentation built on April 9, 2026, 1:06 a.m.