Skip to content

Instantly share code, notes, and snippets.

@JeffreyWay
Created December 18, 2011 15:34
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save JeffreyWay/1493716 to your computer and use it in GitHub Desktop.
Save JeffreyWay/1493716 to your computer and use it in GitHub Desktop.
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