Skip to content

Commit

Permalink
test: add unit tests from std/node (#17794)
Browse files Browse the repository at this point in the history
Adds two test files: "cli/tests/unit_node/process_test.ts" and
"cli/tests/unit_node/child_process_test.ts"

---------

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
  • Loading branch information
bartlomieju and kt3k authored Feb 16, 2023
1 parent 848e2c0 commit 4c2380a
Show file tree
Hide file tree
Showing 26 changed files with 1,471 additions and 80 deletions.
2 changes: 2 additions & 0 deletions cli/tests/integration/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ mod js_unit_tests;
mod lint;
#[path = "lsp_tests.rs"]
mod lsp;
#[path = "node_unit_tests.rs"]
mod node_unit_tests;
#[path = "npm_tests.rs"]
mod npm;
#[path = "repl_tests.rs"]
Expand Down
21 changes: 21 additions & 0 deletions cli/tests/integration/node_unit_tests.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use test_util as util;

#[test]
fn node_unit_tests() {
let _g = util::http_server();

let mut deno = util::deno_cmd()
.current_dir(util::root_path())
.arg("test")
.arg("--unstable")
.arg("-A")
.arg(util::tests_path().join("unit_node"))
.spawn()
.expect("failed to spawn script");

let status = deno.wait().expect("failed to wait for the child process");
assert_eq!(Some(0), status.code());
assert!(status.success());
}
Loading

0 comments on commit 4c2380a

Please sign in to comment.