diff --git a/cli/tests/integration/test_tests.rs b/cli/tests/integration/test_tests.rs index b9b2d41ff4..36bd6b94ce 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 0000000000..5cb1508973 --- /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 0000000000..a3f32968a0 --- /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 0000000000..a3f32968a0 --- /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 0000000000..a3f32968a0 --- /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 () {});