Created
July 5, 2016 02:13
-
-
Save kingcons/db5e8ed22d3365a2b2eb5986db1fc4f4 to your computer and use it in GitHub Desktop.
ye olde 20 line test lib
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 it = function (description, contents) { | |
console.log('\n\n"It ' + description + '"'); | |
contents(); | |
}; | |
let expect = function (target) { | |
return { | |
toBe: function(expectation) { | |
if (target === expectation) { | |
console.log('\n %cPASSED', 'color:green;', 'Expected', target, 'to be', expectation); | |
return true; | |
} else { | |
console.log('\n %cFAILED', 'color:red;', 'Expected', target, 'to be', expectation); | |
return false; | |
} | |
} | |
}; | |
}; | |
export {it, expect}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment