R/utils_tests.R

Defines functions export.viewer.test export.plotly.test export.plot.test

# Function to export a plot to the testoutput folder
export.plot.test <- function(code, filename, plotwidth = 8, plotheight = 8) {

  testthat::expect_true(1 == 1)

}


# Function to export a plotly widget to a test page
export.plotly.test <- function(widget, filename) {

  testthat::expect_true(inherits(widget, "plotly"))

}


# Function to export a viewer widget instance as a plot to the testoutput folder
# it also replaces library paths in each file to match library paths in the
# package to help with debugging
export.viewer.test <- function(widget, filename, widgetname = "RacViewer") {

  # Expect widget created successfully
  testthat::expect_true(inherits(widget, "htmlwidget"))

}

Try the Racmacs package in your browser

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

Racmacs documentation built on June 22, 2024, 11:33 a.m.