summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/test_util.rs4
-rw-r--r--cli/tests/compiler_api_test.out16
-rw-r--r--cli/tests/integration_tests.rs39
-rw-r--r--cli/tests/workers_test.out12
4 files changed, 34 insertions, 37 deletions
diff --git a/cli/test_util.rs b/cli/test_util.rs
index 4fda808ce..890b2783f 100644
--- a/cli/test_util.rs
+++ b/cli/test_util.rs
@@ -19,6 +19,10 @@ pub fn root_path() -> PathBuf {
PathBuf::from(concat!(env!("CARGO_MANIFEST_DIR"), "/.."))
}
+pub fn tests_path() -> PathBuf {
+ root_path().join("cli").join("tests")
+}
+
pub fn target_dir() -> PathBuf {
let current_exe = std::env::current_exe().unwrap();
let target_dir = current_exe.parent().unwrap().parent().unwrap();
diff --git a/cli/tests/compiler_api_test.out b/cli/tests/compiler_api_test.out
deleted file mode 100644
index b0071bd5a..000000000
--- a/cli/tests/compiler_api_test.out
+++ /dev/null
@@ -1,16 +0,0 @@
-running 12 tests
-test compilerApiCompileSources ... ok [WILDCARD]
-test compilerApiCompileNoSources ... ok [WILDCARD]
-test compilerApiCompileOptions ... ok [WILDCARD]
-test compilerApiCompileLib ... ok [WILDCARD]
-test compilerApiCompileTypes ... ok [WILDCARD]
-test transpileOnlyApi ... ok [WILDCARD]
-test transpileOnlyApiConfig ... ok [WILDCARD]
-test bundleApiSources ... ok [WILDCARD]
-test bundleApiNoSources ... ok [WILDCARD]
-test bundleApiConfig ... ok [WILDCARD]
-test bundleApiJsModules ... ok [WILDCARD]
-test diagnosticsTest ... ok [WILDCARD]
-
-test result: ok. 12 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out [WILDCARD]
-
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index 1d02226b4..456c6eece 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -952,16 +952,37 @@ itest!(deno_test {
output: "deno_test.out",
});
-itest!(workers {
- args: "test --reload --allow-net workers_test.ts",
- http_server: true,
- output: "workers_test.out",
-});
+#[test]
+fn workers() {
+ let g = util::http_server();
+ let status = util::deno_cmd()
+ .current_dir(util::tests_path())
+ .arg("test")
+ .arg("--reload")
+ .arg("--allow-net")
+ .arg("workers_test.ts")
+ .spawn()
+ .unwrap()
+ .wait()
+ .unwrap();
+ assert!(status.success());
+ drop(g);
+}
-itest!(compiler_api {
- args: "test --unstable --reload compiler_api_test.ts",
- output: "compiler_api_test.out",
-});
+#[test]
+fn compiler_api() {
+ let status = util::deno_cmd()
+ .current_dir(util::tests_path())
+ .arg("test")
+ .arg("--unstable")
+ .arg("--reload")
+ .arg("compiler_api_test.ts")
+ .spawn()
+ .unwrap()
+ .wait()
+ .unwrap();
+ assert!(status.success());
+}
itest!(_027_redirect_typescript {
args: "run --reload 027_redirect_typescript.ts",
diff --git a/cli/tests/workers_test.out b/cli/tests/workers_test.out
deleted file mode 100644
index 903226283..000000000
--- a/cli/tests/workers_test.out
+++ /dev/null
@@ -1,12 +0,0 @@
-running 9 tests
-test worker terminate ... ok [WILDCARD]
-test worker nested ... ok [WILDCARD]
-test worker throws when executing ... ok [WILDCARD]
-test worker fetch API ... ok [WILDCARD]
-test worker terminate busy loop ... ok [WILDCARD]
-test worker race condition ... ok [WILDCARD]
-test worker is event listener ... ok [WILDCARD]
-test worker scope is event listener ... ok [WILDCARD]
-test worker with Deno namespace ... ok [WILDCARD]
-
-test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out [WILDCARD]