mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Added definitions for jasmine-es6-promise-matchers
This commit is contained in:
parent
7a3ca1f0b8
commit
2b368d620f
@ -0,0 +1,21 @@
|
||||
/// <reference path="jasmine-es6-promise-matchers.d.ts" />
|
||||
|
||||
describe('specs', () => {
|
||||
beforeEach(() => {
|
||||
JasminePromiseMatchers.install
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
JasminePromiseMatchers.uninstall
|
||||
});
|
||||
|
||||
it('should have correct syntax', (done) => {
|
||||
var foo = {};
|
||||
var bar = {};
|
||||
|
||||
expect(foo).toBeResolvedWith(bar, done);
|
||||
expect(foo).toBeRejectedWith(bar, done);
|
||||
expect(foo).toBeResolved(done);
|
||||
expect(foo).toBeRejected(done);
|
||||
});
|
||||
})
|
||||
36
jasmine-es6-promise-matchers/jasmine-es6-promise-matchers.d.ts
vendored
Normal file
36
jasmine-es6-promise-matchers/jasmine-es6-promise-matchers.d.ts
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
// Type definitions for jasmine-es6-promise-matchers
|
||||
// Project: https://github.com/bvaughn/jasmine-es6-promise-matchers
|
||||
// Definitions by: Stephen Lautier <https://github.com/stephenlautier>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jasmine/jasmine.d.ts" />
|
||||
|
||||
declare module JasminePromiseMatchers {
|
||||
export function install():void;
|
||||
export function uninstall():void;
|
||||
}
|
||||
|
||||
declare module jasmine {
|
||||
|
||||
interface Matchers {
|
||||
/**
|
||||
* Verifies that a Promise is (or has been) rejected.
|
||||
*/
|
||||
toBeRejected(done?: () => void): boolean;
|
||||
|
||||
/**
|
||||
* Verifies that a Promise is (or has been) rejected with the specified parameter.
|
||||
*/
|
||||
toBeRejectedWith(value: any, done?: () => void): boolean;
|
||||
|
||||
/**
|
||||
* Verifies that a Promise is (or has been) resolved.
|
||||
*/
|
||||
toBeResolved(done?: () => void): boolean;
|
||||
|
||||
/**
|
||||
* Verifies that a Promise is (or has been) resolved with the specified parameter.
|
||||
*/
|
||||
toBeResolvedWith(value: any, done?: () => void): boolean;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user