summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/Cargo.toml51
-rw-r--r--cli/tests/integration/cert_tests.rs8
-rw-r--r--cli/tests/integration/inspector_tests.rs2
-rw-r--r--cli/tests/integration/js_unit_tests.rs2
-rw-r--r--cli/tests/integration/node_unit_tests.rs2
-rw-r--r--cli/tests/integration/run_tests.rs2
-rw-r--r--cli/tests/integration_tests.rs1
-rw-r--r--cli/tests/integration_tests_runner.rs18
-rw-r--r--cli/tests/lib.rs1
9 files changed, 79 insertions, 8 deletions
diff --git a/cli/tests/Cargo.toml b/cli/tests/Cargo.toml
new file mode 100644
index 000000000..6ad5984e2
--- /dev/null
+++ b/cli/tests/Cargo.toml
@@ -0,0 +1,51 @@
+# Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+[package]
+name = "cli_tests"
+version = "0.0.0"
+authors.workspace = true
+autotests = false
+edition.workspace = true
+license.workspace = true
+repository.workspace = true
+
+[lib]
+path = "lib.rs"
+
+[features]
+run = []
+
+[[test]]
+name = "integration_tests"
+path = "integration_tests.rs"
+required-features = ["run"]
+
+[dev-dependencies]
+bytes.workspace = true
+deno_ast.workspace = true
+deno_bench_util.workspace = true
+deno_core = { workspace = true, features = ["include_js_files_for_snapshotting", "unsafe_use_unprotected_platform"] }
+deno_fetch.workspace = true
+deno_lockfile.workspace = true
+deno_tls.workspace = true
+fastwebsockets = { workspace = true, features = ["upgrade", "unstable-split"] }
+flaky_test = "=0.1.0"
+http.workspace = true
+http-body-util.workspace = true
+hyper.workspace = true
+hyper-util.workspace = true
+once_cell.workspace = true
+os_pipe.workspace = true
+pretty_assertions.workspace = true
+serde.workspace = true
+serde_repr.workspace = true
+test_util.workspace = true
+tokio.workspace = true
+tokio-util.workspace = true
+tower-lsp.workspace = true
+trust-dns-client = "=0.22.0"
+trust-dns-server = "=0.22.1"
+url.workspace = true
+
+[target.'cfg(unix)'.dev-dependencies]
+nix.workspace = true
diff --git a/cli/tests/integration/cert_tests.rs b/cli/tests/integration/cert_tests.rs
index 484d053f8..9e89a9f3e 100644
--- a/cli/tests/integration/cert_tests.rs
+++ b/cli/tests/integration/cert_tests.rs
@@ -1,14 +1,14 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-use deno_runtime::deno_net::ops_tls::TlsStream;
-use deno_runtime::deno_tls::rustls;
-use deno_runtime::deno_tls::rustls_pemfile;
-use lsp_types::Url;
+use deno_tls::rustls;
+use deno_tls::rustls_pemfile;
+use deno_tls::rustls_tokio_stream::TlsStream;
use std::io::BufReader;
use std::io::Cursor;
use std::io::Read;
use std::sync::Arc;
use test_util as util;
+use url::Url;
use util::testdata_path;
use util::TestContext;
diff --git a/cli/tests/integration/inspector_tests.rs b/cli/tests/integration/inspector_tests.rs
index 872f9e3d2..bbe70ae5e 100644
--- a/cli/tests/integration/inspector_tests.rs
+++ b/cli/tests/integration/inspector_tests.rs
@@ -6,7 +6,7 @@ use deno_core::error::AnyError;
use deno_core::serde_json;
use deno_core::serde_json::json;
use deno_core::url;
-use deno_runtime::deno_fetch::reqwest;
+use deno_fetch::reqwest;
use fastwebsockets::FragmentCollector;
use fastwebsockets::Frame;
use fastwebsockets::WebSocket;
diff --git a/cli/tests/integration/js_unit_tests.rs b/cli/tests/integration/js_unit_tests.rs
index 748c0fe5a..0e3a1a118 100644
--- a/cli/tests/integration/js_unit_tests.rs
+++ b/cli/tests/integration/js_unit_tests.rs
@@ -7,7 +7,7 @@ use test_util as util;
util::unit_test_factory!(
js_unit_test,
- "tests/unit",
+ "../tests/unit",
"*.ts",
[
abort_controller_test,
diff --git a/cli/tests/integration/node_unit_tests.rs b/cli/tests/integration/node_unit_tests.rs
index b0259663d..5afaf48c5 100644
--- a/cli/tests/integration/node_unit_tests.rs
+++ b/cli/tests/integration/node_unit_tests.rs
@@ -8,7 +8,7 @@ use util::env_vars_for_npm_tests;
util::unit_test_factory!(
node_unit_test,
- "tests/unit_node",
+ "../tests/unit_node",
"**/*_test.ts",
[
_fs_access_test = _fs / _fs_access_test,
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs
index 3d14bb0bb..428de3238 100644
--- a/cli/tests/integration/run_tests.rs
+++ b/cli/tests/integration/run_tests.rs
@@ -3,7 +3,7 @@
use bytes::Bytes;
use deno_core::serde_json::json;
use deno_core::url;
-use deno_runtime::deno_fetch::reqwest;
+use deno_fetch::reqwest;
use pretty_assertions::assert_eq;
use std::io::Read;
use std::io::Write;
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index 967cf6afe..8469b5416 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -3,4 +3,5 @@
// The tests exist in a sub folder instead of as separate files in
// this directory so that cargo doesn't compile each file as a new crate.
+#[cfg(test)]
mod integration;
diff --git a/cli/tests/integration_tests_runner.rs b/cli/tests/integration_tests_runner.rs
new file mode 100644
index 000000000..12e83a019
--- /dev/null
+++ b/cli/tests/integration_tests_runner.rs
@@ -0,0 +1,18 @@
+// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+pub fn main() {
+ let mut args = vec!["cargo", "test", "-p", "cli_tests", "--features", "run"];
+
+ if !cfg!(debug_assertions) {
+ args.push("--release");
+ }
+
+ args.push("--");
+
+ // If any args were passed to this process, pass them through to the child
+ let orig_args = std::env::args().skip(1).collect::<Vec<_>>();
+ let orig_args: Vec<&str> =
+ orig_args.iter().map(|x| x.as_ref()).collect::<Vec<_>>();
+ args.extend(orig_args);
+
+ test_util::spawn::exec_replace("cargo", &args).unwrap();
+}
diff --git a/cli/tests/lib.rs b/cli/tests/lib.rs
new file mode 100644
index 000000000..0a39b9f87
--- /dev/null
+++ b/cli/tests/lib.rs
@@ -0,0 +1 @@
+// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.