From 38c13b10f6a2b7db13f825d5616430cd4baf1a6d Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Tue, 21 Jan 2025 20:57:30 +1300 Subject: [PATCH] organise demo app --- tests/testthat/sampler/.gitignore | 1 + tests/testthat/{ => sampler}/app.R | 0 tests/testthat/test-compile.R | 2 +- tests/testthat/test-deploy.R | 7 ++++--- 4 files changed, 6 insertions(+), 4 deletions(-) rename tests/testthat/{ => sampler}/app.R (100%) diff --git a/tests/testthat/sampler/.gitignore b/tests/testthat/sampler/.gitignore index c8f499a..050e5f1 100644 --- a/tests/testthat/sampler/.gitignore +++ b/tests/testthat/sampler/.gitignore @@ -1,2 +1,3 @@ node_modules +*.rserve.R *.schema.ts diff --git a/tests/testthat/app.R b/tests/testthat/sampler/app.R similarity index 100% rename from tests/testthat/app.R rename to tests/testthat/sampler/app.R diff --git a/tests/testthat/test-compile.R b/tests/testthat/test-compile.R index 43db551..55ea5e3 100644 --- a/tests/testthat/test-compile.R +++ b/tests/testthat/test-compile.R @@ -41,6 +41,6 @@ test_that("anonomous functions", { test_that("Compile files", { f <- tempfile(fileext = ".rserve.ts") on.exit(unlink(f)) - res <- ts_compile("app.R", file = f) + res <- ts_compile("sampler/app.R", file = f) expect_true(file.exists(f)) }) diff --git a/tests/testthat/test-deploy.R b/tests/testthat/test-deploy.R index d89ef9b..ff97728 100644 --- a/tests/testthat/test-deploy.R +++ b/tests/testthat/test-deploy.R @@ -1,5 +1,6 @@ test_that("Deploy converts ts functions into valid ocap lists", { - on.exit(if (file.exists("app.rserve.R")) unlink("app.rserve.R")) - ts_deploy("app.R") - expect_true(file.exists("app.rserve.R")) + f <- tempfile(fileext = ".rserve.R") + on.exit(unlink(f)) + ts_deploy("sampler/app.R", file = f) + expect_true(file.exists(f)) })