summaryrefslogtreecommitdiff
path: root/cli/tests/integration_tests.rs
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2021-05-20 00:41:36 +0800
committerBert Belder <bertbelder@gmail.com>2021-05-31 16:37:31 +0200
commit3df9f41dfdcdbfa82da0dd758cab132121420e1a (patch)
tree05c1297cba5f17c6030bdb553a1fc208a29f3474 /cli/tests/integration_tests.rs
parentc5f700ca63a2013e268ee5e71449201fcebbac07 (diff)
test(cli/dts): typecheck examples in declaration files (#10707)
This commits adds two integration tests that typecheck examples in the docstrings in Deno declaration files.
Diffstat (limited to 'cli/tests/integration_tests.rs')
-rw-r--r--cli/tests/integration_tests.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index 19a1a8952..ce1205698 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -18,6 +18,39 @@ use tempfile::TempDir;
use test_util as util;
use tokio::task::LocalSet;
+// TODO(caspervonb): investiate why this fails on Windows.
+#[cfg(unix)]
+#[test]
+fn typecheck_declarations_ns() {
+ let status = util::deno_cmd()
+ .arg("test")
+ .arg("--allow-all")
+ .arg("--doc")
+ .arg(util::root_path().join("cli/dts/lib.deno.ns.d.ts"))
+ .spawn()
+ .unwrap()
+ .wait()
+ .unwrap();
+ assert!(status.success());
+}
+
+// TODO(caspervonb): investiate why this fails on Windows.
+#[cfg(unix)]
+#[test]
+fn typecheck_declarations_unstable() {
+ let status = util::deno_cmd()
+ .arg("test")
+ .arg("--doc")
+ .arg("--allow-all")
+ .arg("--unstable")
+ .arg(util::root_path().join("cli/dts/lib.deno.unstable.d.ts"))
+ .spawn()
+ .unwrap()
+ .wait()
+ .unwrap();
+ assert!(status.success());
+}
+
#[test]
fn js_unit_tests_lint() {
let status = util::deno_cmd()