Skip to content

Instantly share code, notes, and snippets.

@rudev
Forked from JeffreyWay/meThinks.js
Created March 7, 2012 09:42
Show Gist options
  • Save rudev/1992248 to your computer and use it in GitHub Desktop.
Save rudev/1992248 to your computer and use it in GitHub Desktop.
JavaScript: Simple JS Testing
function meThinks(assertion) {
return {
shouldEqual: function(bool) {
if ( assertion !== bool ) {
throw new Error('FAIL');
}
}
};
}
meThinks(2 + 2).shouldEqual(4);
meThinks(typeof(jQuery)).shouldEqual('function');
console.log('All tests passed');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment