Skip to content

Instantly share code, notes, and snippets.

@tooky
Last active March 7, 2016 08:20
Show Gist options
  • Save tooky/dbd96adaa3188779bdcc to your computer and use it in GitHub Desktop.
Save tooky/dbd96adaa3188779bdcc to your computer and use it in GitHub Desktop.
it('can be returned like a promise', () => {
let expectedError = new Error('I am not good.');
let SafePromise = safePromises.failWith(actualError => {
expect(actualError).to.equal(expectedError);
});
return SafePromise.reject(expectedError)
.then(() => { throw new Error('should be caught') })
.catch()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment