-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathDay6Tests.html
142 lines (114 loc) · 4.35 KB
/
Day6Tests.html
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Day6 Tests</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-1.23.1.css">
<script src="./day6.js"></script>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="https://code.jquery.com/qunit/qunit-1.23.1.js"></script>
<script type="text/javascript">
QUnit.test("average test 1", function( assert ) {
assert.ok(average([1, 2, 3]) === 2, "Passed!" );
});
QUnit.test("average test 2", function( assert ) {
assert.ok(average([0, 0, 0, -1, 1, 6]) === 1, "Passed!" );
});
QUnit.test("assignGrade test 1", function( assert ) {
assert.ok(assignGrade(95) === 'A', "Passed!" );
});
QUnit.test("assignGrade test 2", function( assert ) {
assert.ok(assignGrade(50) === 'F', "Passed!" );
});
QUnit.test("pluralize test 1", function( assert ) {
assert.ok(pluralize(1, "cat") === "1 cat", "Passed!" );
});
QUnit.test("pluralize test 2", function( assert ) {
assert.ok(pluralize(15, "dog") === "15 dogs", "Passed!" );
});
QUnit.test("longestWord test 1", function( assert ) {
assert.ok(longestWord("hey what is up hello how are you doing today") === "hello", "Passed!" );
});
QUnit.test("palindrome test 1", function( assert ) {
assert.ok(palindrome("racecar") === "yes", "Passed!" );
});
QUnit.test("palindrome test 2", function( assert ) {
assert.ok(palindrome("moom") === "yes", "Passed!" );
});
QUnit.test("palindrome test 3", function( assert ) {
assert.ok(palindrome("iXperience") === "no", "Passed!" );
});
QUnit.test("palindrome test 4", function( assert ) {
assert.ok(palindrome("mommy") === "no", "Passed!" );
});
QUnit.test("letterCounter test 1", function( assert ) {
assert.ok(letterCounter("my name is allie", "l") === 2, "Passed!" );
});
QUnit.test("letterCounter test 2", function( assert ) {
assert.ok(letterCounter("my name is allie", "z") === 0, "Passed!" );
});
QUnit.test("letterCounter test 3", function( assert ) {
assert.ok(letterCounter("whats goin on duuuuuude", "o") === 2, "Passed!" );
});
QUnit.test("longestPalindrome test 1", function( assert ) {
assert.ok(longestPalindrome("hey whats up here a sentence") === "sentence is not a palindrome", "Passed!" );
});
QUnit.test("longestPalindrome test 2", function( assert ) {
assert.ok(longestPalindrome("long word racecar") === "racecar is a palindrome", "Passed!" );
});
QUnit.test("doItTwice test 1", function( assert ) {
assert.ok(doItTwice(function f() { return "hi"; }) === "hihi", "Passed!" );
});
QUnit.test("doItTwice test 2", function( assert ) {
assert.ok(doItTwice(function f() { return 1; }) === 2, "Passed!" );
});
QUnit.test("objectFun test 1", function( assert ) {
assert.ok(objectFun("Allie", "Ivener", 21, "[email protected]", "blue")["first_name"] === "Allie", "Passed!" );
});
QUnit.test("objectFun test 2", function( assert ) {
assert.ok(objectFun("Allie", "Ivener", 21, "[email protected]", "blue")["last_name"] === "Ivener", "Passed!" );
});
QUnit.test("objectFun test 3", function( assert ) {
assert.ok(objectFun("Allie", "Ivener", 21, "[email protected]", "blue")["age"] === 21, "Passed!" );
});
QUnit.test("objectFun test 4", function( assert ) {
assert.ok(objectFun("Allie", "Ivener", 21, "[email protected]", "blue")["fav_color"] === "blue", "Passed!" );
});
QUnit.test("numChildren test 1", function( assert ) {
var testObj = {
name: "Sue",
age: 45,
hometown: "Cape Town",
children: [
{
name: "Billy",
age: 5
},
{
name: "Sally",
age: 8
},
{
name: "Joey",
age: 12
}
]
}
assert.ok(numChildren(testObj) === 3, "Passed!" );
});
QUnit.test("sayHello test 1", function( assert ) {
assert.ok(sayHello("Allie", "Ivener", greeting) === "Hello, Allie Ivener!", "Passed!" );
});
QUnit.test("sayGoodnight test 1", function( assert ) {
assert.ok(sayGoodnight("Allie", "Night", goodnight) === "Goodnight, Allie!", "Passed!" );
});
QUnit.test("sayGoodnight test 2", function( assert ) {
assert.ok(sayGoodnight("Allie", "Morning", goodnight) === "It's not bedtime!", "Passed!" );
});
</script>
</body>
</html>