forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(test): Add more overloads for "Deno.test" (denoland#12749)
This commit adds 4 more overloads to "Deno.test()" API. ``` // Deno.test(function testName() { }); export function test(fn: (t: TestContext) => void | Promise<void>): void; // Deno.test("test name", { only: true }, function() { }); export function test( name: string, options: Omit<TestDefinition, "name">, fn: (t: TestContext) => void | Promise<void>, ): void; // Deno.test({ name: "test name" }, function() { }); export function test( options: Omit<TestDefinition, "fn">, fn: (t: TestContext) => void | Promise<void>, ): void; // Deno.test({ only: true }, function testName() { }); export function test( options: Omit<TestDefinition, "fn" | "name">, fn: (t: TestContext) => void | Promise<void>, ): void; ```
- Loading branch information
1 parent
ae34f8f
commit d8afd56
Showing
7 changed files
with
246 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Check [WILDCARD]/test/overloads.ts | ||
running 6 tests from [WILDCARD]/test/overloads.ts | ||
test test0 ... ok ([WILDCARD]) | ||
test test1 ... ok ([WILDCARD]) | ||
test test2 ... ok ([WILDCARD]) | ||
test test3 ... ok ([WILDCARD]) | ||
test test4 ... ok ([WILDCARD]) | ||
test test5 ... ignored ([WILDCARD]) | ||
|
||
test result: ok. 5 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out ([WILDCARD]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Deno.test("test0", () => {}); | ||
Deno.test(function test1() {}); | ||
Deno.test({ name: "test2", fn: () => {} }); | ||
Deno.test("test3", { permissions: "none" }, () => {}); | ||
Deno.test({ name: "test4" }, () => {}); | ||
Deno.test({ ignore: true }, function test5() {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters