Skip to content

Commit

Permalink
Add doc test
Browse files Browse the repository at this point in the history
  • Loading branch information
SyrupThinker committed Jun 27, 2020
1 parent 9fc2977 commit 846a8cd
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cli/tests/doc/generic_tuple.out
@@ -0,0 +1,2 @@
function f(): Generic<[string, number]>

4 changes: 4 additions & 0 deletions cli/tests/doc/generic_tuple.ts
@@ -0,0 +1,4 @@
interface Generic<_T> {}
export function f(): Generic<[string, number]> {
return {};
}
23 changes: 23 additions & 0 deletions cli/tests/integration_tests.rs
Expand Up @@ -45,6 +45,29 @@ fn std_lint() {
assert!(status.success());
}

#[test]
fn doc_tests() {
for file in util::root_path().join("cli/tests/doc").as_path().read_dir().unwrap() {
let file = file.unwrap();
assert!(file.file_type().unwrap().is_file());

let name = file.file_name();
let name = name.to_str().unwrap();

if name.ends_with(".js") || name.ends_with(".ts") {
let doc_path = file.path();
let mut out_path = doc_path.clone();
out_path.set_extension("out");

(util::CheckOutputIntegrationTest {
args: &format!("doc {}", doc_path.to_str().unwrap()),
output: out_path.to_str().unwrap(),
..Default::default()
}).run();
}
}
}

#[test]
fn x_deno_warning() {
let g = util::http_server();
Expand Down

0 comments on commit 846a8cd

Please sign in to comment.