-
-
Notifications
You must be signed in to change notification settings - Fork 769
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add .resolves and .rejects to stub (#1211)
* Add .resolves and .rejects to stub This commit adds the possibility for a stub to be configured to return a promise which will either resolves or reject This was already possible, but this adds a shorthand for it stub.returns(Promise.resolve({})) -> stub.resolve({}) stub.returns(Promise.reject(new Error("bad luck"))) -> stub.rejects("bad luck") Since Promise are now part of the standard ES6 features, this commit does not make use of polyfill or third party library. This is problematic for some browsers and generally for contexts where the standard is not implemented. * Use native-promise-only for .resolves and .rejects * change test titles for chainable methods
- Loading branch information
Showing
3 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
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
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
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