-
-
Save TheSavior/28efb87995cbee5302a5c0583e9d7ab8 to your computer and use it in GitHub Desktop.
Wrapping a require in try / catch
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
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