Created
January 13, 2017 00:34
-
-
Save tkissing/b42b8d72fc4b2ada1388edb417b45161 to your computer and use it in GitHub Desktop.
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
const chai = require('chai'); | |
module.exports = (t) => { | |
return Object.keys(chai.assert).reduce((prev, curr) => { | |
let assertion = chai.assert[curr]; | |
if (typeof assertion == 'function') { | |
prev[curr] = (...args) => { | |
try { | |
assertion.apply(chai.assert, args); | |
t.ok(true); | |
} catch (e) { | |
t.fail(e.message); | |
} | |
} | |
} | |
return prev; | |
}, {}) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment