Skip to content

Instantly share code, notes, and snippets.

@tkissing
Created January 13, 2017 00:34
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 tkissing/b42b8d72fc4b2ada1388edb417b45161 to your computer and use it in GitHub Desktop.
Save tkissing/b42b8d72fc4b2ada1388edb417b45161 to your computer and use it in GitHub Desktop.
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