Last active
July 13, 2016 18:15
-
-
Save zhangchiqing/842c53984da833abfac6ef76d1ba71e8 to your computer and use it in GitHub Desktop.
promiseShouldFail.js
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
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