mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
test(cli): reorganize test subcommand testcases and fixtures (#9627)
This commit is contained in:
parent
6dae627749
commit
62f33e3b14
13 changed files with 57 additions and 53 deletions
|
@ -2238,28 +2238,6 @@ mod integration {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn deno_test_no_color() {
|
||||
let (out, _) = util::run_and_collect_output(
|
||||
false,
|
||||
"test deno_test_no_color.ts",
|
||||
None,
|
||||
Some(vec![("NO_COLOR".to_owned(), "true".to_owned())]),
|
||||
false,
|
||||
);
|
||||
// ANSI escape codes should be stripped.
|
||||
assert!(out.contains("test success ... ok"));
|
||||
assert!(out.contains("test fail ... FAILED"));
|
||||
assert!(out.contains("test ignored ... ignored"));
|
||||
assert!(out.contains("test result: FAILED. 1 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out"));
|
||||
}
|
||||
|
||||
itest!(test_exit_sanitizer {
|
||||
args: "test exit_sanitizer_test.ts",
|
||||
output: "exit_sanitizer_test.out",
|
||||
exit_code: 1,
|
||||
});
|
||||
|
||||
itest!(stdout_write_all {
|
||||
args: "run --quiet stdout_write_all.ts",
|
||||
output: "stdout_write_all.out",
|
||||
|
@ -2386,42 +2364,68 @@ mod integration {
|
|||
http_server: true,
|
||||
});
|
||||
|
||||
itest!(deno_test {
|
||||
args: "test test_runner_test.ts",
|
||||
mod test {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn no_color() {
|
||||
let (out, _) = util::run_and_collect_output(
|
||||
false,
|
||||
"test test/deno_test_no_color.ts",
|
||||
None,
|
||||
Some(vec![("NO_COLOR".to_owned(), "true".to_owned())]),
|
||||
false,
|
||||
);
|
||||
// ANSI escape codes should be stripped.
|
||||
assert!(out.contains("test success ... ok"));
|
||||
assert!(out.contains("test fail ... FAILED"));
|
||||
assert!(out.contains("test ignored ... ignored"));
|
||||
assert!(out.contains("test result: FAILED. 1 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out"));
|
||||
}
|
||||
|
||||
itest!(all {
|
||||
args: "test test/test_runner_test.ts",
|
||||
exit_code: 1,
|
||||
output: "deno_test.out",
|
||||
output: "test/deno_test.out",
|
||||
});
|
||||
|
||||
itest!(deno_test_fail_fast {
|
||||
args: "test --fail-fast test_runner_test.ts",
|
||||
itest!(fail_fast {
|
||||
args: "test --fail-fast test/test_runner_test.ts",
|
||||
exit_code: 1,
|
||||
output: "deno_test_fail_fast.out",
|
||||
output: "test/deno_test_fail_fast.out",
|
||||
});
|
||||
|
||||
itest!(deno_test_only {
|
||||
args: "test deno_test_only.ts",
|
||||
itest!(only {
|
||||
args: "test test/deno_test_only.ts",
|
||||
exit_code: 1,
|
||||
output: "deno_test_only.ts.out",
|
||||
output: "test/deno_test_only.ts.out",
|
||||
});
|
||||
|
||||
itest!(deno_test_no_check {
|
||||
args: "test --no-check test_runner_test.ts",
|
||||
itest!(no_check {
|
||||
args: "test --no-check test/test_runner_test.ts",
|
||||
exit_code: 1,
|
||||
output: "deno_test.out",
|
||||
output: "test/deno_test.out",
|
||||
});
|
||||
|
||||
itest!(deno_test_finally_cleartimeout {
|
||||
args: "test test_finally_cleartimeout.ts",
|
||||
itest!(finally_cleartimeout {
|
||||
args: "test test/test_finally_cleartimeout.ts",
|
||||
exit_code: 1,
|
||||
output: "test_finally_cleartimeout.out",
|
||||
output: "test/test_finally_cleartimeout.out",
|
||||
});
|
||||
|
||||
itest!(deno_test_unresolved_promise {
|
||||
args: "test test_unresolved_promise.js",
|
||||
itest!(unresolved_promise {
|
||||
args: "test test/test_unresolved_promise.js",
|
||||
exit_code: 1,
|
||||
output: "deno_test_unresolved_promise.out",
|
||||
output: "test/deno_test_unresolved_promise.out",
|
||||
});
|
||||
|
||||
itest!(exit_sanitizer {
|
||||
args: "test test/exit_sanitizer_test.ts",
|
||||
output: "test/exit_sanitizer_test.out",
|
||||
exit_code: 1,
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn timeout_clear() {
|
||||
// https://github.com/denoland/deno/issues/7599
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
import { assert } from "../../test_util/std/testing/asserts.ts";
|
||||
import { assert } from "../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
Deno.test("fail1", function () {
|
||||
assert(false, "fail1 assertion");
|
Loading…
Reference in a new issue