From 680fc0b398a87fa7d19cb377a0decd9665a55982 Mon Sep 17 00:00:00 2001 From: Matt Bishop Date: Tue, 29 Aug 2017 18:23:16 -0700 Subject: [PATCH] Added fix from https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19382 --- types/chai-as-promised/chai-as-promised-tests.ts | 1 + types/chai-as-promised/index.d.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/types/chai-as-promised/chai-as-promised-tests.ts b/types/chai-as-promised/chai-as-promised-tests.ts index 7e422521aa..2157f0cc3c 100644 --- a/types/chai-as-promised/chai-as-promised-tests.ts +++ b/types/chai-as-promised/chai-as-promised-tests.ts @@ -26,6 +26,7 @@ thenableNum = chai.expect(thenableNum).to.notify(() => console.log('done')); // BDD API (should) thenableNum = thenableNum.should.be.fulfilled; thenableNum = thenableNum.should.eventually.deep.equal(3); +thenableNum = thenableNum.should.eventually.become(3); thenableNum = thenableNum.should.become(3); thenableNum = thenableNum.should.be.rejected; thenableNum = thenableNum.should.be.rejectedWith(Error); diff --git a/types/chai-as-promised/index.d.ts b/types/chai-as-promised/index.d.ts index bd67bf90cd..459758aa55 100644 --- a/types/chai-as-promised/index.d.ts +++ b/types/chai-as-promised/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: jt000 , // Yuki Kokubun , // Leonard Thieu , +// Mike Lazer-Walker , // Matt Bishop // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -28,14 +29,14 @@ declare namespace Chai { become(expected: any): PromisedAssertion; fulfilled: PromisedAssertion; rejected: PromisedAssertion; - rejectedWith(expected: any, message?: string | RegExp): PromisedAssertion; + rejectedWith: PromisedThrow; notify(fn: Function): PromisedAssertion; } // Eventually does not have .then(), but PromisedAssertion have. interface Eventually extends PromisedLanguageChains, PromisedNumericComparison, PromisedTypeComparison { // From chai-as-promised - become(expected: PromiseLike): PromisedAssertion; + become(expected: any): PromisedAssertion; fulfilled: PromisedAssertion; rejected: PromisedAssertion; rejectedWith: PromisedThrow;