From 32855f2c853b7f30a92d4cb95549cba8abfd44e5 Mon Sep 17 00:00:00 2001 From: "Yasser A.Idrissi" Date: Mon, 12 Jul 2021 11:55:42 +0100 Subject: feat: Add support for "deno test --fail-fast=N" (#11316) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- cli/tests/test/fail_fast_with_val.out | 23 +++++++++++++++++++++++ cli/tests/test/fail_fast_with_val.ts | 30 ++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 cli/tests/test/fail_fast_with_val.out create mode 100644 cli/tests/test/fail_fast_with_val.ts (limited to 'cli/tests') 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(); +}); -- cgit v1.2.3