From cf92fa3f76215d02932473e18f466bd9a318ae6d Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Wed, 22 Nov 2023 12:45:02 +0100 Subject: [PATCH] remove R pipe from unit tests --- tests/testthat/test-module_nested_tabs.R | 2 ++ tests/testthat/test-module_tabs_with_filters.R | 6 +++--- tests/testthat/test-module_teal_with_splash.R | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/testthat/test-module_nested_tabs.R b/tests/testthat/test-module_nested_tabs.R index 9218bc2f09..db0890ceb7 100644 --- a/tests/testthat/test-module_nested_tabs.R +++ b/tests/testthat/test-module_nested_tabs.R @@ -1,3 +1,5 @@ +teal_data <- teal.data::teal_data() +teal_data <- within(teal_data, iris <- head(iris)) teal_data <- teal.data::teal_data() |> within(iris <- head(iris)) datanames(teal_data) <- "iris" filtered_data <- teal_data_to_filtered_data(teal_data) diff --git a/tests/testthat/test-module_tabs_with_filters.R b/tests/testthat/test-module_tabs_with_filters.R index 4a2880c13b..1c9d1f8385 100644 --- a/tests/testthat/test-module_tabs_with_filters.R +++ b/tests/testthat/test-module_tabs_with_filters.R @@ -1,6 +1,6 @@ -teal_data <- teal.data::teal_data() |> - within(iris <- head(iris)) |> - within(mtcars <- mtcars) +teal_data <- teal.data::teal_data() +teal_data <- within(teal_data, iris <- head(iris)) +teal_data <- within(teal_data, mtcars <- head(mtcars)) datanames(teal_data) <- c("iris", "mtcars") filtered_data <- teal_data_to_filtered_data(teal_data) diff --git a/tests/testthat/test-module_teal_with_splash.R b/tests/testthat/test-module_teal_with_splash.R index 577e997582..a68f047f02 100644 --- a/tests/testthat/test-module_teal_with_splash.R +++ b/tests/testthat/test-module_teal_with_splash.R @@ -96,7 +96,7 @@ testthat::test_that("srv_teal_with_splash teal_data_rv_validate throws then qenv id = "test", data = teal_data_module( ui = function(id) div(), - server = function(id) reactive(teal_data() |> within(stop("not good"))) + server = function(id) reactive(teal_data() %>% within(stop("not good"))) ), modules = modules(example_module()) ),