}
strong b.pass{
color:#5E740B;
-}
\ No newline at end of file
+}
+
+#qunit-fixture {
+ position: absolute;
+ top: -10000px;
+ left: -10000px;
+}
* Resets the test setup. Useful for tests that modify the DOM.
*/
reset: function() {
- if ( window.jQuery ) {
- jQuery("#main").html( config.fixture );
+ var main = id('main') || id('qunit-fixture');
+ if ( main ) {
+ main.innerHTML = config.fixture;
}
}
};
toolbar.appendChild( label );
}
- var main = id('main');
+ var main = id('main') || id('qunit-fixture');
if ( main ) {
config.fixture = main.innerHTML;
}
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
+ <div id="qunit-fixture">test markup</div>
</body>
</html>
raises(thrower2, 'Type!', 'throwing TypeError instance');
raises(thrower3, 'Custom!', 'throwing custom object');
});
+
+module("fixture");
+test("setup", function() {
+ document.getElementById("qunit-fixture").innerHTML = "foobar";
+});
+test("basics", function() {
+ equal( document.getElementById("qunit-fixture").innerHTML, "test markup", "automatically reset" );
+});