Matt Bishop
2017-08-29 18:23:16 -07:00
parent 3cbb7290b1
commit 680fc0b398
2 changed files with 4 additions and 2 deletions

View File

@@ -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);

View File

@@ -3,6 +3,7 @@
// Definitions by: jt000 <https://github.com/jt000>,
// Yuki Kokubun <https://github.com/Kuniwak>,
// Leonard Thieu <https://github.com/leonard-thieu>,
// Mike Lazer-Walker <https://github.com/lazerwalker>,
// Matt Bishop <https://github.com/mattbishop>
// 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<any>): PromisedAssertion;
become(expected: any): PromisedAssertion;
fulfilled: PromisedAssertion;
rejected: PromisedAssertion;
rejectedWith: PromisedThrow;