From 4b1638dccc601ff0282172c7e3ef0f1126a603ed Mon Sep 17 00:00:00 2001 From: Jon Short Date: Thu, 4 Jun 2020 15:43:05 +0100 Subject: feat(std/testing): Allow non-void promises in assertThrowsAsync (#6052) --- std/testing/asserts.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'std/testing/asserts.ts') 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( + fn: () => T, ErrorClass?: Constructor, msgIncludes = "", msg?: string @@ -361,8 +361,8 @@ export function assertThrows( return error; } -export async function assertThrowsAsync( - fn: () => Promise, +export async function assertThrowsAsync( + fn: () => Promise, ErrorClass?: Constructor, msgIncludes = "", msg?: string -- cgit v1.2.3