New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix index.d.ts for noImplicitAny option #638
Conversation
bouzuya
commented
Mar 11, 2016
By analyzing the blame information on this pull request, we identified @ivogabe and @SamVerschueren to be potential reviewers |
@@ -129,11 +129,11 @@ export interface AssertContext { | |||
* Assert that function throws an error or promise rejects. | |||
* @param error Can be a constructor, regex, error message or validation function. | |||
*/ | |||
throws(value: (() => void) | Promise<{}>, error?: ErrorValidator, message?: string); | |||
throws(value: (() => void) | Promise<{}>, error?: ErrorValidator, message?: string): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throws
return the error thrown though: https://github.com/sindresorhus/ava#throwsfunctionpromise-error-message
If you change the return type of |
@ivogabe There's no good way to indicate that |
@sindresorhus yes with |
Indeed, one might write |
Oh yeah. Even though nobody should do that... |
Well, we all know how that goes ;) |
s/void/any/ NOTE:
document:
|
More accurate would be: throws(value: Promise<{}>, error?: ErrorValidator, message?: string): Promise<any>;
throws(value: () => void, error?: ErrorValidator, message?: string): any;
notThrows<U>(value: Promise<U>, message?: string): Promise<U>;
notThrows(value: () => void, message?: string): void; |
fix index.d.ts for noImplicitAny option
Thanks all :) |