QUnit HTML Template
June 26, 2010
A couple of month ago I decided to write my own implementation of operational transforms. For those who aren't familiar, operational transforms (aka OT) is a technology that gives a document the ability to be edited by multiple people simultaneously. This is the technology google wave, google docs, and novell pulse use. OT comes straight out of academia, which means it's described with a set of axioms and theorems. This is unit test heaven.
On the recommendation of a friend, I decided to use qunit for my unit tests. Though writing the tests was fairly straight forward, I had a hell of a time trying to display the results. After stumbling around the internet for a while, I finally decided to read the documentation. Turns out that I should have been using this HTML template:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Unit Test Suites</title>
<link rel="stylesheet" href="http://github.com/jquery/qunit/raw/master/qunit/qunit.css" type="text/css" media="screen" />
</head>
<body>
<h1 id="qunit-header">My Unit Test Suites</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<script type="text/javascript" src="http://github.com/jquery/qunit/raw/master/qunit/qunit.js"></script>
<script type="text/javascript" src="my-library.js"></script>
<script type="text/javascript">
// Unit tests go here...
</script>
</body>
</html>
I figured qunit would auto generate the markup by itself. Guess I was wrong.