Last active
October 8, 2015 20:55
-
-
Save raine/d14dc3d8010274dc640a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const assertRejectedWith = (p, fn) => | |
Promise.all([ | |
assert.isRejected(p), | |
p.catch(fn) | |
]); | |
const assertRejectedWithMsg = (p, str) => | |
assertRejectedWith(p, err => assert.deepEqual(err.message, str)) | |
it('throws if body can\'t be found for the email type', () => { | |
const payload = assoc('type', 'this-type-does-not-exist', PAYLOAD); | |
return assertRejectedWithMsg( | |
testDispatch(defaultTmpls, payload), | |
'Body not found (type=this-type-does-not-exist, lang=en, format=html)' | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment