forked from roblevintennis/Testing-and-Debugging-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqunit_test.html
More file actions
53 lines (43 loc) · 1.75 KB
/
qunit_test.html
File metadata and controls
53 lines (43 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<!-- Alternatively, you may want to download these files and include them relative to your script -->
<script src="http://code.jquery.com/jquery-latest.js"></script>
<link rel="stylesheet" href="http://github.com/jquery/qunit/raw/master/qunit/qunit.css" type="text/css" media="screen" />
<script type="text/javascript" src="http://github.com/jquery/qunit/raw/master/qunit/qunit.js"></script>
<script>
$(document).ready(function(){
test("In the spirit of Rails scaffolding, true is true ;-) ", function() {
expect(2)
ok( true, "true is true alright!" ); // like assertTrue
var artist = "David Bowie";
equals( "David Bowie", artist, "We expect artist to be 'David Bowie'." ); // like assertEquals
});
test("Meaningfully equal objects are the 'same'", function() {
var actual = {name : "Rob", age : "I'd have to kill you!", happy : true};
same( actual,
{name : "Rob", age : "I'd have to kill you!", happy : true},
"Separate but meaningfully equal object are considered the 'same'.");
});
test("Meaningfully equal arrays are the 'same'", function() {
var actual = [1,2,3,4,"five"];
same( actual, [1,2,3,4,"five"], "Separate but meaningfully equal arrays are considered the 'same'.");
});
module("My Module");
test("Module Test 1", function() {
ok( true, "This bettor pass!" );
});
test("Module Test 2", function() {
ok( true, "So better this!" );
});
});
</script>
</head>
<body>
<h1 id="qunit-header">QUnit example</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
</body>
</html>