QUnit example

A simple example of QUnit tests using JSFiddle

by Trey Hunner

HTML

<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.12.0.css">
<script src="http://code.jquery.com/qunit/qunit-1.12.0.js"></script>
<div id="qunit"></div>
<div id="qunit-fixture"></div>

JavaScript

test("A simple passing test", function () {
    equal(1, "1", 'Test that 1 == "1"');
});

test("A failing test", function () {
    equal(1, 2, "Test that 1 == 2");
});