diff options
author | Yasser A.Idrissi <getspookydev@gmail.com> | 2021-07-12 11:55:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-12 12:55:42 +0200 |
commit | 32855f2c853b7f30a92d4cb95549cba8abfd44e5 (patch) | |
tree | ec2b9dbcd7f023ee6be6d941599221276d4275e9 /cli/tests | |
parent | 0bc54a0099c70dc05326a2b4a7aa5b0273b1bf1c (diff) |
feat: Add support for "deno test --fail-fast=N" (#11316)
This commit adds support for specifying threshold in the "--fail-fast"
flag for "deno test" subcommand. Previously using "--fail-fast" stopped
running the test suite after first failure and with this change users
may specify number of failed tests that will cause the suite to be interrupted.
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/test/fail_fast_with_val.out | 23 | ||||
-rw-r--r-- | cli/tests/test/fail_fast_with_val.ts | 30 |
2 files changed, 53 insertions, 0 deletions
diff --git a/cli/tests/test/fail_fast_with_val.out b/cli/tests/test/fail_fast_with_val.out new file mode 100644 index 000000000..a902e4c7b --- /dev/null +++ b/cli/tests/test/fail_fast_with_val.out @@ -0,0 +1,23 @@ +[WILDCARD] +running 10 tests from [WILDCARD]/test/fail_fast_with_val.ts +test test 1 ... FAILED ([WILDCARD]) +test test 2 ... FAILED ([WILDCARD]) + +failures: + +test 1 +Error + at [WILDCARD]/test/fail_fast_with_val.ts:2:9 + at [WILDCARD] + +test 2 +Error + at [WILDCARD]/test/fail_fast_with_val.ts:5:9 + at [WILDCARD] + +failures: + + test 1 + test 2 + +test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) diff --git a/cli/tests/test/fail_fast_with_val.ts b/cli/tests/test/fail_fast_with_val.ts new file mode 100644 index 000000000..637e825ec --- /dev/null +++ b/cli/tests/test/fail_fast_with_val.ts @@ -0,0 +1,30 @@ +Deno.test("test 1", () => { + throw new Error(); +}); +Deno.test("test 2", () => { + throw new Error(); +}); +Deno.test("test 3", () => { + throw new Error(); +}); +Deno.test("test 4", () => { + throw new Error(); +}); +Deno.test("test 5", () => { + throw new Error(); +}); +Deno.test("test 6", () => { + throw new Error(); +}); +Deno.test("test 7", () => { + throw new Error(); +}); +Deno.test("test 8", () => { + throw new Error(); +}); +Deno.test("test 9", () => { + throw new Error(); +}); +Deno.test("test 0", () => { + throw new Error(); +}); |