Skip to content

Instantly share code, notes, and snippets.

@nicksheffield
Created April 24, 2012 01:31
Show Gist options
  • Save nicksheffield/2475321 to your computer and use it in GitHub Desktop.
Save nicksheffield/2475321 to your computer and use it in GitHub Desktop.
Short easy test function - inspired by Angular JS
function expect(value){
return {
val: value,
toBe: function(that){
if(this.val == that) return true;
else return false;
}
};
}
var name = 'Nick';
expect(name).toBe('Nick'); // true
expect(name).toBe('John'); // false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment