Skip to content

Instantly share code, notes, and snippets.

@zhangchiqing
Last active July 13, 2016 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhangchiqing/842c53984da833abfac6ef76d1ba71e8 to your computer and use it in GitHub Desktop.
Save zhangchiqing/842c53984da833abfac6ef76d1ba71e8 to your computer and use it in GitHub Desktop.
promiseShouldFail.js
var promiseShouldFail = function(promise) {
return new Promise(function(resolve, reject) {
promise.then(reject).catch(resolve);
});
};
describe('This rejected promise', function() {
it('should fail', function() {
return promiseShouldFail(Promise.reject(10));
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment