Skip to content

Instantly share code, notes, and snippets.

@web20opensource
Forked from anonymous/jsbin.orupad.html
Created July 28, 2013 08:24
Show Gist options
  • Save web20opensource/6097933 to your computer and use it in GitHub Desktop.
Save web20opensource/6097933 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Test Suite</title>
<script>
function assert( value, desc ) {
var li = document.createElement("li");
li.className = value ? "pass" : "fail";
li.appendChild( document.createTextNode( desc ) );
document.getElementById("results").appendChild( li );
}
window.onload = function(){
assert( true, "The test suite is running." );
assert( false, "Fail!" );
};
</script>
<style>
#results li.pass { color: green; }
#results li.fail { color: red; }
</style>
</head>
<body>
<ul id="results"></ul>
</body>
</html>
@web20opensource
Copy link
Author

A simple implementation of a JavaScript test suite - Secrets of the Javascript Ninja - Resig, J.

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