https://github.com/ansman/jasmine-promise
Support for promises in Jasmine
https://github.com/ansman/jasmine-promise
Last synced: 11 months ago
JSON representation
Support for promises in Jasmine
- Host: GitHub
- URL: https://github.com/ansman/jasmine-promise
- Owner: ansman
- License: mit
- Created: 2013-12-31T12:58:37.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2015-02-06T07:23:14.000Z (over 11 years ago)
- Last Synced: 2025-03-06T14:53:03.739Z (over 1 year ago)
- Language: JavaScript
- Size: 160 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Jasmine promise
===
Adds supports for returning promises in specs.
Usage
---
Simply include the `jasmine-promise.js` file before your specs and then you can
use it in your tests:
```javascript
decribe("My module", function() {
it.promise("does awesome things", function() {
return new Promise(function(resolve, reject) {
expect(something).toBe(somethingElse);
if (someCondition)
resolve();
else
reject("Some error");
});
});
});
```
For more examples see [`jasmine-promise-spec.js`](https://github.com/ansman/jasmine-promise/tree/master/specs/jasmine-promise-spec.js).
Supported versions
---
All versions of Jasmine should be supported.
1.3.1 and 2.0 have both been tested.
License
---
jasmine-promise is licensed under the [MIT license](https://github.com/ansman/jasmine-promise/tree/master/LICENSE).