From a7b3bbe98956563c2a2f965c17c2ffd96fd2e309 Mon Sep 17 00:00:00 2001 From: Michal Hruby Date: Tue, 4 Apr 2017 22:37:45 +0100 Subject: [PATCH 1/4] Added support for Promise assertions to should --- types/should/index.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/types/should/index.d.ts b/types/should/index.d.ts index 6060fa68cc..918e82a6ba 100644 --- a/types/should/index.d.ts +++ b/types/should/index.d.ts @@ -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; + fulfilledWith(value: any): Promise + rejected(): Promise; + rejectedWith(err: Error | string | RegExp): Promise; + //http header(field: string, val?: string): ShouldAssertion; status(code: number): ShouldAssertion; From 0ef9f445a4666b66b81bf36fc853904b3c7be449 Mon Sep 17 00:00:00 2001 From: Michal Hruby Date: Tue, 4 Apr 2017 22:43:36 +0100 Subject: [PATCH 2/4] Bump version --- types/should/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/should/index.d.ts b/types/should/index.d.ts index 918e82a6ba..db78e6e087 100644 --- a/types/should/index.d.ts +++ b/types/should/index.d.ts @@ -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 , Maxime LUCE // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 005c373632753cde709a8a053e46a7beb5a5194f Mon Sep 17 00:00:00 2001 From: Michal Hruby Date: Thu, 6 Apr 2017 09:18:33 +0100 Subject: [PATCH 3/4] Keep should and should-promised compatible --- types/should-promised/index.d.ts | 6 ++---- types/should/index.d.ts | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/types/should-promised/index.d.ts b/types/should-promised/index.d.ts index 75432273bf..065237f45e 100644 --- a/types/should-promised/index.d.ts +++ b/types/should-promised/index.d.ts @@ -5,10 +5,8 @@ interface ShouldAssertion { Promise: ShouldAssertion; - fulfilled(): ShouldAssertion; - rejected(): ShouldAssertion; - rejectedWith(message: (string | Function | RegExp), properties?: Object): ShouldAssertion; - rejectedWith(message: Object): ShouldAssertion; + fulfilled: Promise; + rejected: Promise; finally: ShouldAssertion; eventually: ShouldAssertion; } diff --git a/types/should/index.d.ts b/types/should/index.d.ts index db78e6e087..0a5038d027 100644 --- a/types/should/index.d.ts +++ b/types/should/index.d.ts @@ -99,7 +99,8 @@ interface ShouldAssertion { fulfilled(): Promise; fulfilledWith(value: any): Promise rejected(): Promise; - rejectedWith(err: Error | string | RegExp): Promise; + rejectedWith(message: (string | Function | RegExp), properties?: Object): Promise; + rejectedWith(errType: Object): Promise; //http header(field: string, val?: string): ShouldAssertion; From fefb9017e7f77b3ce6fc24de86b12cf37fab51ec Mon Sep 17 00:00:00 2001 From: Michal Hruby Date: Thu, 6 Apr 2017 09:50:05 +0100 Subject: [PATCH 4/4] Drop everything from should-promised --- types/should-promised/index.d.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/types/should-promised/index.d.ts b/types/should-promised/index.d.ts index 065237f45e..0c17b970f7 100644 --- a/types/should-promised/index.d.ts +++ b/types/should-promised/index.d.ts @@ -4,9 +4,5 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface ShouldAssertion { - Promise: ShouldAssertion; - fulfilled: Promise; - rejected: Promise; - finally: ShouldAssertion; - eventually: ShouldAssertion; + // all of the extensions are now part of should itself }