test(cli): add test for test filtering (#11672)

This commit is contained in:
Casper Beyer 2021-08-13 17:33:18 +08:00 committed by GitHub
parent c1f97056f4
commit 293eed0ef2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 0 deletions

View file

@ -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,

12
cli/tests/testdata/test/filter.out vendored Normal file
View file

@ -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])

View file

@ -0,0 +1,3 @@
Deno.test("foo", function () {});
Deno.test("bar", function () {});
Deno.test("baz", function () {});

View file

@ -0,0 +1,3 @@
Deno.test("foo", function () {});
Deno.test("bar", function () {});
Deno.test("baz", function () {});

View file

@ -0,0 +1,3 @@
Deno.test("foo", function () {});
Deno.test("bar", function () {});
Deno.test("baz", function () {});