tests/testthat/test_js.R

context("JavaScript code / data accessors")

test_that("get property", {
  # Prepare
  property_name <- "coordinates"

  # Act
  js_code <- get_property(property_name)

  # Assert
  expect_equal(js_code, JS("data => data.coordinates"))
})

test_that("get color", {
  # Prepare
  color_property <- "color"

  # Act
  js_code <- get_color_to_rgb_array(color_property)

  # Assert
  expect_equal(js_code, JS("d => _deckWidget.convertColor(d.color)"))
})

Try the deckgl package in your browser

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

deckgl documentation built on March 7, 2023, 5:37 p.m.