Skip to content

Instantly share code, notes, and snippets.

@rezkam
Created February 25, 2013 18:16
Show Gist options
  • Save rezkam/5031965 to your computer and use it in GitHub Desktop.
Save rezkam/5031965 to your computer and use it in GitHub Desktop.
<!doctype html>
<html lang="en">
<head>
<title>Test Suite with CSS</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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment