From 0e1855e7d1e02ff7c42d6b0e6b010d4249f714ee Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 2 Aug 2024 13:32:14 +0200 Subject: [PATCH] added basic tests closes #9 --- DESCRIPTION | 3 +++ tests/testthat.R | 12 ++++++++++++ tests/testthat/test-node.R | 9 +++++++++ 3 files changed, 24 insertions(+) create mode 100644 tests/testthat.R create mode 100644 tests/testthat/test-node.R diff --git a/DESCRIPTION b/DESCRIPTION index 202db51..26b8fc8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -13,3 +13,6 @@ Imports: digest, jsonlite, rlang +Suggests: + testthat (>= 3.0.0) +Config/testthat/edition: 3 diff --git a/tests/testthat.R b/tests/testthat.R new file mode 100644 index 0000000..3741575 --- /dev/null +++ b/tests/testthat.R @@ -0,0 +1,12 @@ +# This file is part of the standard setup for testthat. +# It is recommended that you do not modify it. +# +# Where should you do additional test configuration? +# Learn more about the roles of various files in: +# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview +# * https://testthat.r-lib.org/articles/special-files.html + +library(testthat) +library(flowr) + +test_check("flowr") diff --git a/tests/testthat/test-node.R b/tests/testthat/test-node.R new file mode 100644 index 0000000..e7da02a --- /dev/null +++ b/tests/testthat/test-node.R @@ -0,0 +1,9 @@ +test_that("find package directory", { + expect_no_error(get_default_node_base_dir()) +}) +test_that("install node", { + expect_no_error(install_node("22.5.1")) +}) +test_that("install flowr", { + expect_no_error(install_flowr("2.0.11")) +})