Skip to content

Commit

Permalink
Update flow def for AssertContext.throws to match typescript def (#1443)
Browse files Browse the repository at this point in the history
Having a specific promise resolution value of Error was causing issues
with methods that throw a custom error object.

Fixes #1442
  • Loading branch information
dancoates authored and novemberborn committed Jul 12, 2017
1 parent 3f6e134 commit 4a769f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ type AssertContext = {
// Assert that function throws an error or promise rejects.
// @param error Can be a constructor, regex, error message or validation function.
throws: {
(value: PromiseLike<mixed>, error?: ErrorValidator, message?: string): Promise<Error>;
(value: () => mixed, error?: ErrorValidator, message?: string): Error;
(value: PromiseLike<mixed>, error?: ErrorValidator, message?: string): Promise<any>;
(value: () => mixed, error?: ErrorValidator, message?: string): any;
};
// Assert that function doesn't throw an error or promise resolves.
notThrows: {
Expand Down

0 comments on commit 4a769f8

Please sign in to comment.