expect_equal_plots: Compares JASP plots in unit tests.

View source: R/testthat-helper-plots.R

expect_equal_plotsR Documentation

Compares JASP plots in unit tests.

Description

This function compares a stored .svg of a plot, to the plot that is created when the tests are run. If no .svg exists yet then you must first run manageTestPlots.

Usage

expect_equal_plots(test, name, dir = lifecycle::deprecated())

Arguments

test

The plot object you wish to test (does not work well for non-ggplot2 objects).

name

The name of the reference plot (a .svg stored in /tests/testthat/_snaps).

dir

[Deprecated]

Examples


options <- analysisOptions("BinomialTest")
options$variables <- "contBinom"
options$descriptivesPlots <- TRUE
results <- runAnalysis("BinomialTest", "test.csv", options)
testPlot <- results[["state"]][["figures"]][[1]][["obj"]]
expect_equal_plots(testPlot, "descriptives-1", dir = "BinomialTest")


jasp-stats/JASPTools documentation built on April 24, 2024, 11:18 a.m.