Skip to content

Commit 4a769f8

Browse files
dancoatesnovemberborn
authored andcommitted
Update flow def for AssertContext.throws to match typescript def (#1443)
Having a specific promise resolution value of Error was causing issues with methods that throw a custom error object. Fixes #1442
1 parent 3f6e134 commit 4a769f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js.flow

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ type AssertContext = {
5858
// Assert that function throws an error or promise rejects.
5959
// @param error Can be a constructor, regex, error message or validation function.
6060
throws: {
61-
(value: PromiseLike<mixed>, error?: ErrorValidator, message?: string): Promise<Error>;
62-
(value: () => mixed, error?: ErrorValidator, message?: string): Error;
61+
(value: PromiseLike<mixed>, error?: ErrorValidator, message?: string): Promise<any>;
62+
(value: () => mixed, error?: ErrorValidator, message?: string): any;
6363
};
6464
// Assert that function doesn't throw an error or promise resolves.
6565
notThrows: {

0 commit comments

Comments
 (0)