diff options
Diffstat (limited to 'std/testing/asserts.ts')
-rw-r--r-- | std/testing/asserts.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/std/testing/asserts.ts b/std/testing/asserts.ts index 18cf9134e..5f5c3a7c5 100644 --- a/std/testing/asserts.ts +++ b/std/testing/asserts.ts @@ -325,8 +325,8 @@ export function fail(msg?: string): void { * throws. An error class and a string that should be included in the * error message can also be asserted. */ -export function assertThrows( - fn: () => void, +export function assertThrows<T = void>( + fn: () => T, ErrorClass?: Constructor, msgIncludes = "", msg?: string @@ -361,8 +361,8 @@ export function assertThrows( return error; } -export async function assertThrowsAsync( - fn: () => Promise<void>, +export async function assertThrowsAsync<T = void>( + fn: () => Promise<T>, ErrorClass?: Constructor, msgIncludes = "", msg?: string |