1+ skip_if_not_installed(" shinytest" )
2+
13expect_msg_helper <- function (expr , message , fixed , expect_fn , ... ) {
24 if (is.na(message )) {
35 if (interactive()) {
@@ -52,10 +54,10 @@ expect_migration_error <- function(
5254) {
5355 expect_msg_helper(
5456 # migrated_expr <-
55- m__shinytest_lang(
56- rlang :: enexpr(original_expr ),
57- info_env
58- ),
57+ m__shinytest_lang(
58+ rlang :: enexpr(original_expr ),
59+ info_env
60+ ),
5961 message = message ,
6062 fixed = fixed ,
6163 expect_fn = testthat :: expect_error
@@ -65,7 +67,6 @@ expect_migration_error <- function(
6567}
6668
6769
68-
6970test_that(" setInputs is converted" , {
7071 expect_migration(
7172 app $ setInputs(x = 1 , allowInputNoBinding_ = TRUE , y = 2 ),
@@ -137,15 +138,17 @@ test_that("click is converted", {
137138})
138139
139140
140-
141141test_that(" executeScript is converted" , {
142142 expect_migration(
143143 app $ executeScript(" 1 + 1" ),
144144 app $ get_js(script = " 1 + 1" , timeout = 10000 )
145145 )
146146 expect_migration(
147147 app $ executeScript(" 1 + 1" , x = 1 , y = 2 ),
148- app $ get_js(script = " let arguments_ = {\" x\" :1,\" y\" :2};\n 1 + 1" , timeout = 10000 )
148+ app $ get_js(
149+ script = " let arguments_ = {\" x\" :1,\" y\" :2};\n 1 + 1" ,
150+ timeout = 10000
151+ )
149152 )
150153})
151154
@@ -470,7 +473,12 @@ test_that("takeScreenshot is converted", {
470473 )
471474
472475 expect_migration(
473- app $ uploadFile(timeout_ = 2 , myid = " file.png" , wait_ = FALSE , values_ = FALSE ),
476+ app $ uploadFile(
477+ timeout_ = 2 ,
478+ myid = " file.png" ,
479+ wait_ = FALSE ,
480+ values_ = FALSE
481+ ),
474482 app $ upload_file(myid = " file.png" , wait_ = FALSE , timeout_ = 2 )
475483 )
476484})
@@ -495,7 +503,12 @@ test_that("waitForShiny is converted", {
495503test_that(" waitForValue is converted" , {
496504 expect_migration(
497505 app $ waitForValue(myname , ignore = foo(), timeout = 2 , checkInterval = 3 ),
498- app $ wait_for_value(input = myname , ignore = foo(), timeout = 2 , interval = 3 )
506+ app $ wait_for_value(
507+ input = myname ,
508+ ignore = foo(),
509+ timeout = 2 ,
510+ interval = 3
511+ )
499512 )
500513 expect_migration(
501514 app $ waitForValue(myname , iotype = " output" ),
@@ -544,23 +557,26 @@ test_that("snapshot is converted", {
544557 rlang :: exprs(
545558 app $ expect_values(),
546559 app $ expect_screenshot()
547- ), enexpr_new_expr = FALSE
560+ ),
561+ enexpr_new_expr = FALSE
548562 )
549563 # Use a char
550564 expect_snapshot_migration(
551565 app $ snapshot(items = list (output = " myoutput" )),
552566 rlang :: exprs(
553567 app $ expect_values(output = " myoutput" ),
554568 app $ expect_screenshot()
555- ), enexpr_new_expr = FALSE
569+ ),
570+ enexpr_new_expr = FALSE
556571 )
557572 # Respect language
558573 expect_snapshot_migration(
559574 app $ snapshot(items = list (output = myoutputvar )),
560575 rlang :: exprs(
561576 app $ expect_values(output = myoutputvar ),
562577 app $ expect_screenshot()
563- ), enexpr_new_expr = FALSE
578+ ),
579+ enexpr_new_expr = FALSE
564580 )
565581 # Turn off expect_screenshot if compare_images is false
566582 expect_snapshot_migration(
0 commit comments