Skip to content

Instantly share code, notes, and snippets.

@javisantana
Created May 9, 2011 18:17
Show Gist options
  • Save javisantana/963037 to your computer and use it in GitHub Desktop.
Save javisantana/963037 to your computer and use it in GitHub Desktop.
quick'n'dirty javascript testing framework
// test utils
function assert(desc, b) {
document.write("**" + desc + "</br>" );
document.write(b ? "OK": "FAIL");
document.write("</br>");
document.write("</br>");
}
function test(desc, fn) {
assert(desc, fn())
}
/* usage:
function add(a, b) { return a+b; }
test("should add two integer numbers", function() {
return add(1, 2) == 3;
});
*/
@marcelinollano
Copy link

Lovely

@javisantana
Copy link
Author

me gusta más el de raul https://gist.github.com/963499

@marcelinollano
Copy link

marcelinollano commented May 11, 2011 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment