Last active
June 20, 2018 16:59
-
-
Save sadick254/86dd9afa540213a74eb6badfbebd7a48 to your computer and use it in GitHub Desktop.
This file contains hidden or 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"); | |
// .. code | |
function expect(actual) { | |
return { | |
toEqual(expected) { | |
assert.equal(actual, expected); | |
}, | |
toBe(expected) { | |
assert.deepStrictEqual(actual, expected); | |
}, | |
toBeTruthy() { | |
assert.ok(actual); | |
}, | |
toHaveLength(expected) { | |
assert.ok(actual.length === expected); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment