tests/testthat/test-transform_events.R

testd <- readr::read_csv("./test_data/current_program_a360_full_data.csv",
  col_types = paste0(rep("c", 43), collapse = "")
)
testd <- testd[1:1000, ]

d <- jsonlite::read_json(path = "clone.psi-mis.org/api/events.json-ad1479.json", simplifyVector = T)

test_that("events are correctly transformed", {
  d <- transform_events(d$events)
  d2 <- transform_events(testd) # test - find latest

  #expect_equal(names(d), required_fields)
  expect_equal(names(d2), required_fields)
})
psi-mis/a360connect documentation built on Nov. 22, 2022, 12:36 p.m.