Skip to content

Instantly share code, notes, and snippets.

@TheSavior
Created August 22, 2016 05:30
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 TheSavior/28efb87995cbee5302a5c0583e9d7ab8 to your computer and use it in GitHub Desktop.
Save TheSavior/28efb87995cbee5302a5c0583e9d7ab8 to your computer and use it in GitHub Desktop.
Wrapping a require in try / catch
let chai;
try {
chai = require('chai');
} catch (err) {}
if (chai) {
chai.assert.equal = function() {
throw new chai.AssertionError("Chai's assert.equal function does == instead of ===. Use assert.strictEqual instead");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment