mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
Merge pull request #15657 from mhr3/should-with-promise-assertions
Added support for Promise assertions to "should"
This commit is contained in:
Vendored
+1
-7
@@ -4,11 +4,5 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface ShouldAssertion {
|
||||
Promise: ShouldAssertion;
|
||||
fulfilled(): ShouldAssertion;
|
||||
rejected(): ShouldAssertion;
|
||||
rejectedWith(message: (string | Function | RegExp), properties?: Object): ShouldAssertion;
|
||||
rejectedWith(message: Object): ShouldAssertion;
|
||||
finally: ShouldAssertion;
|
||||
eventually: ShouldAssertion;
|
||||
// all of the extensions are now part of should itself
|
||||
}
|
||||
|
||||
Vendored
+11
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for should.js v8.1.1
|
||||
// Type definitions for should.js v8.3.0
|
||||
// Project: https://github.com/shouldjs/should.js
|
||||
// Definitions by: Alex Varju <https://github.com/varju/>, Maxime LUCE <https://github.com/SomaticIT/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -42,6 +42,7 @@ interface ShouldAssertion {
|
||||
Class(): ShouldAssertion;
|
||||
Undefined(): ShouldAssertion;
|
||||
Null(): ShouldAssertion;
|
||||
Promise(): ShouldAssertion;
|
||||
generator(): ShouldAssertion;
|
||||
iterable(): ShouldAssertion;
|
||||
iterator(): ShouldAssertion;
|
||||
@@ -92,6 +93,15 @@ interface ShouldAssertion {
|
||||
endWith(expected: string, message?: any): ShouldAssertion;
|
||||
throw(message?: any): ShouldAssertion;
|
||||
|
||||
//promises
|
||||
eventually: ShouldAssertion;
|
||||
finally: ShouldAssertion;
|
||||
fulfilled(): Promise<any>;
|
||||
fulfilledWith(value: any): Promise<any>
|
||||
rejected(): Promise<any>;
|
||||
rejectedWith(message: (string | Function | RegExp), properties?: Object): Promise<any>;
|
||||
rejectedWith(errType: Object): Promise<any>;
|
||||
|
||||
//http
|
||||
header(field: string, val?: string): ShouldAssertion;
|
||||
status(code: number): ShouldAssertion;
|
||||
|
||||
Reference in New Issue
Block a user