Forked from: Akiyah's QUnit sample diff(30) forked: QUnit sample GeckoTang Follow 2012-01-10 20:29:54 License: MIT License Fork0 Fav0 View1097 Play Stop Reload Fullscreen Smart Phone Readme JavaScript 50 lines HTML 12 lines CSS 1 lines forked: QUnit sample jQuery v1.7.1 QUnit // forked from Akiyah's "QUnit sample" http://jsdo.it/Akiyah/497D $(document).ready(function(){ function hoge (x) { return x; }; function fuga () { return false; } test("a basic test example", function() { var test1 = $('#test1'); var test2 = $('#test1-1'); var array = test2.find('div').toArray().reverse(); test2.html(array); equals(test1.html(), test2.html(), "equals" ); }); test("a basic test example", function() { for(var i=0; i<10; i++){ ok(true); } expect(10); }); /* test("a basic test example", function() { ok( true, "this test is fine" ); var value = "hello"; equals( "hello", value, "We expect value to be hello" ); }); module("Module A"); test("first test within module", function() { ok( true, "all pass" ); }); test("second test within module", function() { ok( true, "all pass" ); }); module("Module B"); test("some other test", function() { expect(2); equals( true, false, "failing test" ); equals( true, true, "passing test" ); }); */ }); <h1 id="qunit-header">QUnit example</h1> <h2 id="qunit-banner"></h2> <div id="qunit-testrunner-toolbar"></div> <h2 id="qunit-userAgent"></h2> <ol id="qunit-tests"></ol> <div id="qunit-fixture">test markup, will be hidden</div> <div id="test1"><div>1</div><div>2</div><div>3</div></div> <div id="test1-1"><div>3</div><div>2</div><div>1</div></div> forked: QUnit sample QUnit body { background-color: #DDDDDD; font: 30px sans-serif; } // forked from Akiyah's "QUnit sample" http://jsdo.it/Akiyah/497D $(document).ready(function(){ function hoge (x) { return x; }; function fuga () { return false; } test("a basic test example", function() { var test1 = $('#test1'); var test2 = $('#test1-1'); var array = test2.find('div').toArray().reverse(); test2.html(array); equals(test1.html(), test2.html(), "equals" ); }); test("a basic test example", function() { for(var i=0; i<10; i++){ ok(true); } expect(10); }); /* test("a basic test example", function() { ok( true, "this test is fine" ); var value = "hello"; equals( "hello", value, "We expect value to be hello" ); }); module("Module A"); test("first test within module", function() { ok( true, "all pass" ); }); test("second test within module", function() { ok( true, "all pass" ); }); module("Module B"); test("some other test", function() { expect(2); equals( true, false, "failing test" ); equals( true, true, "passing test" ); }); */ }); <h1 id="qunit-header">QUnit example</h1> <h2 id="qunit-banner"></h2> <div id="qunit-testrunner-toolbar"></div> <h2 id="qunit-userAgent"></h2> <ol id="qunit-tests"></ol> <div id="qunit-fixture">test markup, will be hidden</div> <div id="test1"><div>1</div><div>2</div><div>3</div></div> <div id="test1-1"><div>3</div><div>2</div><div>1</div></div> body { background-color: #DDDDDD; font: 30px sans-serif; } use an iframe compat browser, deer Tweet QR code Embed Design view Code view <script type="text/javascript" src="http://jsdo.it/blogparts/4AQr/js?view=design"></script><p class="ttlBpJsdoit" style="width: 465px; margin: 0; text-align: right; font-size: 11px;"><a href="http://jsdo.it/GeckoTang/4AQr" title="forked: QUnit sample">forked: QUnit sample - jsdo.it - share JavaScript, HTML5 and CSS</a></p> zip tags QUnit sample Tweet twitter Tags QUnit sample