Created
February 22, 2016 16:49
-
-
Save eschwartz/2b8d675882c68e743623 to your computer and use it in GitHub Desktop.
Extend assert
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 assert = require('assert'); | |
// Wrap `assert()` | |
const assertExt = (val, msg) => assert(val, msg); | |
// Extend assert properties | |
Object.assign(assertExt, assert, { | |
someCustomAssertion: require('./assert/some-custom-assertion') | |
}); | |
module.exports = assertExt; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Automagical version: