forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request DefinitelyTyped#4766 from matthewjh/jasmine-promis…
…e-matchers-2 adds type definitions for jasmine-promise-matchers
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
jasmine-promise-matchers/jasmine-promise-matchers-tests.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/// <reference path="jasmine-promise-matchers.d.ts" /> | ||
|
||
describe('something', () => { | ||
beforeEach(() => { | ||
installPromiseMatchers(); | ||
}); | ||
|
||
it('should do something', () => { | ||
var foo = {}; | ||
var bar = {}; | ||
|
||
expect(foo).toBeResolvedWith(bar); | ||
expect(foo).toBeRejectedWith(bar); | ||
expect(foo).toBeResolved(); | ||
expect(foo).toBeRejected(); | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Type definitions for jasmine-promise-matchers | ||
// Project: https://github.com/bvaughn/jasmine-promise-matchers | ||
// Definitions by: Matthew Hill <https://github.com/matthewjh> | ||
// Definitions: https://github.com/borisyankov/DefinitelyTyped | ||
|
||
/// <reference path="../jasmine/jasmine.d.ts" /> | ||
|
||
declare function installPromiseMatchers(): void; | ||
|
||
declare module jasmine { | ||
|
||
interface Matchers { | ||
/** | ||
* Verifies that a Promise is (or has been) rejected. | ||
*/ | ||
toBeRejected(): boolean; | ||
|
||
/** | ||
* Verifies that a Promise is (or has been) rejected with the specified parameter. | ||
*/ | ||
toBeRejectedWith(value: any): boolean; | ||
|
||
/** | ||
* Verifies that a Promise is (or has been) resolved. | ||
*/ | ||
toBeResolved(): boolean; | ||
|
||
/** | ||
* Verifies that a Promise is (or has been) resolved with the specified parameter. | ||
*/ | ||
toBeResolvedWith(value: any): boolean; | ||
} | ||
} |