2024-01-01 14:58:21 -05:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2023-02-17 23:58:52 +09:00
|
|
|
|
|
|
|
use test_util as util;
|
2023-08-29 13:02:54 -06:00
|
|
|
use util::env_vars_for_npm_tests;
|
2023-02-17 23:58:52 +09:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn node_compat_tests() {
|
|
|
|
let mut deno = util::deno_cmd()
|
|
|
|
.current_dir(util::root_path())
|
|
|
|
.arg("test")
|
2024-02-07 16:21:32 -07:00
|
|
|
.arg("--config")
|
chore: move cli/tests/ -> tests/ (#22369)
This looks like a massive PR, but it's only a move from cli/tests ->
tests, and updates of relative paths for files.
This is the first step towards aggregate all of the integration test
files under tests/, which will lead to a set of integration tests that
can run without the CLI binary being built.
While we could leave these tests under `cli`, it would require us to
keep a more complex directory structure for the various test runners. In
addition, we have a lot of complexity to ignore various test files in
the `cli` project itself (cargo publish exclusion rules, autotests =
false, etc).
And finally, the `tests/` folder will eventually house the `test_ffi`,
`test_napi` and other testing code, reducing the size of the root repo
directory.
For easier review, the extremely large and noisy "move" is in the first
commit (with no changes -- just a move), while the remainder of the
changes to actual files is in the second commit.
2024-02-10 13:22:13 -07:00
|
|
|
.arg("tests/config/deno.json")
|
2024-02-07 16:21:32 -07:00
|
|
|
.arg("--no-lock")
|
2023-02-17 23:58:52 +09:00
|
|
|
.arg("--unstable")
|
|
|
|
.arg("-A")
|
|
|
|
.arg(util::tests_path().join("node_compat"))
|
|
|
|
.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());
|
|
|
|
}
|
2023-08-02 01:17:38 +02:00
|
|
|
|
|
|
|
itest!(node_test_module {
|
|
|
|
args: "test node/test.js",
|
|
|
|
output: "node/test.out",
|
2023-08-29 13:02:54 -06:00
|
|
|
envs: env_vars_for_npm_tests(),
|
2023-08-02 01:17:38 +02:00
|
|
|
exit_code: 1,
|
2023-08-29 13:02:54 -06:00
|
|
|
http_server: true,
|
2023-08-02 01:17:38 +02:00
|
|
|
});
|