diff --git a/index.js.flow b/index.js.flow index 98480205e..54367a94e 100644 --- a/index.js.flow +++ b/index.js.flow @@ -31,7 +31,7 @@ type ErrorValidator = | ((error: any) => boolean); /** - * Asertion Types + * Assertion Types */ type AssertContext = { @@ -57,11 +57,15 @@ type AssertContext = { notDeepEqual(value: U, expected: U, message?: string): void; // Assert that function throws an error or promise rejects. // @param error Can be a constructor, regex, error message or validation function. - throws(value: PromiseLike, error?: ErrorValidator, message?: string): Promise; - throws(value: () => void, error?: ErrorValidator, message?: string): mixed; + throws: { + (value: PromiseLike, error?: ErrorValidator, message?: string): Promise; + (value: () => mixed, error?: ErrorValidator, message?: string): Error; + }; // Assert that function doesn't throw an error or promise resolves. - notThrows(value: PromiseLike, message?: string): Promise; - notThrows(value: () => void, message?: string): void; + notThrows: { + notThrows(value: PromiseLike, message?: string): Promise; + notThrows(value: () => mixed, message?: string): void; + }; // Assert that contents matches regex. regex(contents: string, regex: RegExp, message?: string): void; // Assert that contents does not match regex.