mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Added definition and tests for should-promised library
This commit is contained in:
parent
7d298be1db
commit
8a8c7be52c
21
should-promised/should-promised-tests.ts
Normal file
21
should-promised/should-promised-tests.ts
Normal file
@ -0,0 +1,21 @@
|
||||
/// <reference path="../should/should.d.ts" />
|
||||
/// <reference path="should-promised.d.ts" />
|
||||
/// <reference path="../bluebird/bluebird.d.ts" />
|
||||
|
||||
var promise: Promise<number> = new Promise<number>(function (resolve, reject) {});
|
||||
|
||||
promise.should.be.Promise;
|
||||
(10).should.not.be.a.Promise;
|
||||
|
||||
promise.should.be.fulfilled;
|
||||
|
||||
promise.should.be.rejected;
|
||||
|
||||
promise.should.be.rejectedWith(Error);
|
||||
promise.should.be.rejectedWith('boom');
|
||||
promise.should.be.rejectedWith(/boom/);
|
||||
promise.should.be.rejectedWith(Error, { message: 'boom' });
|
||||
promise.should.be.rejectedWith({ message: 'boom' });
|
||||
|
||||
promise.should.be.eventually.equal(10);
|
||||
promise.should.be.finally.equal(10);
|
||||
14
should-promised/should-promised.d.ts
vendored
Normal file
14
should-promised/should-promised.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
// Type definitions for should-promised
|
||||
// Project: https://github.com/shouldjs/promised
|
||||
// Definitions by: Yaroslav Admin <https://github.com/devoto13/>
|
||||
// Definitions: https://github.com/borisyankov/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;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user