From 9e282155b77c2ea6168e2dbed5adad9137828190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 13 Jan 2023 02:59:13 +0100 Subject: tests: move integration tests to a single module (#17380) Effectively reverts changes done in https://github.com/denoland/deno/pull/16816 --- cli/tests/integration/js_unit_tests.rs | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 cli/tests/integration/js_unit_tests.rs (limited to 'cli/tests/integration/js_unit_tests.rs') diff --git a/cli/tests/integration/js_unit_tests.rs b/cli/tests/integration/js_unit_tests.rs new file mode 100644 index 000000000..46e66ab77 --- /dev/null +++ b/cli/tests/integration/js_unit_tests.rs @@ -0,0 +1,39 @@ +// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. + +use test_util as util; + +#[test] +fn js_unit_tests_lint() { + let status = util::deno_cmd() + .arg("lint") + .arg("--unstable") + .arg(util::tests_path().join("unit")) + .spawn() + .unwrap() + .wait() + .unwrap(); + assert!(status.success()); +} + +#[test] +fn js_unit_tests() { + let _g = util::http_server(); + + // Note that the unit tests are not safe for concurrency and must be run with a concurrency limit + // of one because there are some chdir tests in there. + // TODO(caspervonb) split these tests into two groups: parallel and serial. + let mut deno = util::deno_cmd() + .current_dir(util::root_path()) + .arg("test") + .arg("--unstable") + .arg("--location=http://js-unit-tests/foo/bar") + .arg("--no-prompt") + .arg("-A") + .arg(util::tests_path().join("unit")) + .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()); +} -- cgit v1.2.3