diff options
author | Casper Beyer <caspervonb@pm.me> | 2021-08-13 17:33:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-13 11:33:18 +0200 |
commit | 293eed0ef2de1bf1563811e3a1fe3fafb436636d (patch) | |
tree | c96ac33532e19738daf0ed8922255eff1e622057 | |
parent | c1f97056f42d20158d469d023652f3b338411007 (diff) |
test(cli): add test for test filtering (#11672)
-rw-r--r-- | cli/tests/integration/test_tests.rs | 6 | ||||
-rw-r--r-- | cli/tests/testdata/test/filter.out | 12 | ||||
-rw-r--r-- | cli/tests/testdata/test/filter/a_test.ts | 3 | ||||
-rw-r--r-- | cli/tests/testdata/test/filter/b_test.ts | 3 | ||||
-rw-r--r-- | cli/tests/testdata/test/filter/c_test.ts | 3 |
5 files changed, 27 insertions, 0 deletions
diff --git a/cli/tests/integration/test_tests.rs b/cli/tests/integration/test_tests.rs index b9b2d41ff..36bd6b94c 100644 --- a/cli/tests/integration/test_tests.rs +++ b/cli/tests/integration/test_tests.rs @@ -139,6 +139,12 @@ itest!(unhandled_rejection { output: "test/unhandled_rejection.out", }); +itest!(filter { + args: "test --filter=foo test/filter", + exit_code: 0, + output: "test/filter.out", +}); + itest!(shuffle { args: "test --shuffle test/shuffle", exit_code: 0, diff --git a/cli/tests/testdata/test/filter.out b/cli/tests/testdata/test/filter.out new file mode 100644 index 000000000..5cb150897 --- /dev/null +++ b/cli/tests/testdata/test/filter.out @@ -0,0 +1,12 @@ +Check [WILDCARD]/test/filter/a_test.ts +Check [WILDCARD]/test/filter/b_test.ts +Check [WILDCARD]/test/filter/c_test.ts +running 1 test from [WILDCARD]/test/filter/a_test.ts +test foo ... ok ([WILDCARD]) +running 1 test from [WILDCARD]/test/filter/b_test.ts +test foo ... ok ([WILDCARD]) +running 1 test from [WILDCARD]/test/filter/c_test.ts +test foo ... ok ([WILDCARD]) + +test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 6 filtered out ([WILDCARD]) + diff --git a/cli/tests/testdata/test/filter/a_test.ts b/cli/tests/testdata/test/filter/a_test.ts new file mode 100644 index 000000000..a3f32968a --- /dev/null +++ b/cli/tests/testdata/test/filter/a_test.ts @@ -0,0 +1,3 @@ +Deno.test("foo", function () {}); +Deno.test("bar", function () {}); +Deno.test("baz", function () {}); diff --git a/cli/tests/testdata/test/filter/b_test.ts b/cli/tests/testdata/test/filter/b_test.ts new file mode 100644 index 000000000..a3f32968a --- /dev/null +++ b/cli/tests/testdata/test/filter/b_test.ts @@ -0,0 +1,3 @@ +Deno.test("foo", function () {}); +Deno.test("bar", function () {}); +Deno.test("baz", function () {}); diff --git a/cli/tests/testdata/test/filter/c_test.ts b/cli/tests/testdata/test/filter/c_test.ts new file mode 100644 index 000000000..a3f32968a --- /dev/null +++ b/cli/tests/testdata/test/filter/c_test.ts @@ -0,0 +1,3 @@ +Deno.test("foo", function () {}); +Deno.test("bar", function () {}); +Deno.test("baz", function () {}); |