mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
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.
This commit is contained in:
parent
ba09ce0729
commit
df7639c096
3 changed files with 35 additions and 5 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue