Skip to content

Commit

Permalink
fixed node_modules path on non-windows (#31)
Browse files Browse the repository at this point in the history
* fixed node_modules path on non-windows

* test whether the flowr installation worked correctly

* be verbose when testing

* try sleeping until the server has started up when testing

* just check flowr version in node test

* pass a vector for the version

* be verbose

* use node 22.9.0 in tests

* get rid of the test for now, bleh
  • Loading branch information
Ellpeck authored Oct 2, 2024
1 parent f4abad2 commit 874b1e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion R/node.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ install_flowr <- function(flowr_ver, verbose = FALSE, base_dir = get_default_nod
#' @export
exec_flowr <- function(args, verbose = FALSE, base_dir = get_default_node_base_dir(), background = FALSE) {
# we installed flowr globally (see above) in the scope of our local node installation, so we can find it here
flowr_path <- file.path(get_node_exe_dir(base_dir), "node_modules", "@eagleoutice", "flowr", "cli", "flowr.js")
node_modules <- if (get_os() == "win") "node_modules" else file.path("lib", "node_modules")
flowr_path <- file.path(get_node_exe_dir(base_dir), node_modules, "@eagleoutice", "flowr", "cli", "flowr.js")
exec_node_command("node", c(flowr_path, args), verbose, base_dir, background)
}

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-node.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ test_that("find package directory", {
})
test_that("install node", {
options(timeout = 300)
expect_no_error(install_node("22.5.1"))
expect_no_error(install_node("22.9.0", TRUE))
})
test_that("install flowr", {
expect_equal(install_flowr("2.0.11"), 0)
expect_equal(install_flowr("2.0.11", TRUE), 0)
})

0 comments on commit 874b1e2

Please sign in to comment.