Added support for Promise assertions to should

This commit is contained in:
Michal Hruby
2017-04-04 22:37:45 +01:00
parent 742cb488d6
commit a7b3bbe989

View File

@@ -42,6 +42,7 @@ interface ShouldAssertion {
Class(): ShouldAssertion;
Undefined(): ShouldAssertion;
Null(): ShouldAssertion;
Promise(): ShouldAssertion;
generator(): ShouldAssertion;
iterable(): ShouldAssertion;
iterator(): ShouldAssertion;
@@ -92,6 +93,14 @@ 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(err: Error | string | RegExp): Promise<any>;
//http
header(field: string, val?: string): ShouldAssertion;
status(code: number): ShouldAssertion;