Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vandenman committed Nov 5, 2024
1 parent 8b28eee commit 451668f
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 31 deletions.
1 change: 1 addition & 0 deletions inst/Description.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Description
website : "https://sophieberkhout.github.io/"
license : "GPL (>= 2)"
icon : "analysis-time-series.svg"
preloadData: true

Analysis
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ARIMATimeSeries/ljung-box-plot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions tests/testthat/helper-options.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

analysisOptionsFromJaspDescriptives <- function(functionName) {

filename <- switch(
functionName,
"DescriptivesTimeSeries" = "DescriptivesTimeSeriesForm.qml"

)

path <- system.file("qml", "common", filename, package = "jaspDescriptives")

if (!file.exists(path))
stop("Could not find the QML file for \"", functionName, "\" at path:", path)

return(jaspTools:::readQML(path))
}
2 changes: 1 addition & 1 deletion tests/testthat/test-ARIMATimeSeries.R
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@ test_that("Time Series Plot matches", {
plotName <- results[["results"]][["timeSeriesPlot"]][["data"]]
testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]]
jaspTools::expect_equal_plots(testPlot, "time-series-plot3")
})
})
5 changes: 3 additions & 2 deletions tests/testthat/test-DescriptivesTimeSeries.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
context("Descriptives Time Series")

options <- jaspTools::analysisOptions("DescriptivesTimeSeries")
# options <- jaspTools::analysisOptions("DescriptivesTimeSeries")
options <- analysisOptionsFromJaspDescriptives("DescriptivesTimeSeries")
options$dependent <- "visits"
options$time <- "date"
options$lagPlot <- TRUE
Expand Down Expand Up @@ -39,4 +40,4 @@ test_that("Time Series Plot matches", {
plotName <- results[["results"]][["timeSeriesPlot"]][["data"]]
testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]]
jaspTools::expect_equal_plots(testPlot, "time-series-plot-desc")
})
})

0 comments on commit 451668f

Please sign in to comment.