Skip to content

Commit 337d90d

Browse files
committed
test commit
1 parent 094f694 commit 337d90d

File tree

4 files changed

+24
-18
lines changed

4 files changed

+24
-18
lines changed

topics/about_asserts.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
module("About Asserts (topics/about_asserts.js)");
33

44
test("ok", function() {
5-
ok(__, 'what will satisfy the ok assertion?');
5+
ok(true, 'what will satisfy the ok assertion?');
66
});
77

88
test("not", function() {
9-
not(__, 'what is a false value?');
9+
not(false, 'what is a false value?');
1010
});
1111

12-
test("equals", function() {
13-
equals(1+1, __, 'what will satisfy the equals assertion?');
14-
});
12+
test("equals", function() {
13+
equals(1+1, 2, 'what will satisfy the equals assertion?');
14+
});

topics/about_operators.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,43 @@
11

22
module("About Operators (topics/about_operators.js)");
33

4-
test("addition", function() {
4+
test("addition",
5+
function() {
56
var result = 0;
67
//starting i at 0, add i to result and increment i by 1 until i is equal to 5
78
for (var i = 0; i <= 5; i++) {
8-
result = result + i;
9-
}
10-
equals(result, __, "What is the value of result?");
11-
});
9+
result = result + i;
10+
}
11+
12+
equals(result, 15, "What is the value of result?");
13+
}
14+
);
1215

1316
test("assignment addition", function() {
1417
var result = 0;
1518
for (var i = 0; i <=5; i++) {
1619
//the code below is just like saying result = result + i; but is more concise
1720
result += i;
1821
}
19-
equals(result, __, "What is the value of result?");
22+
23+
equals(result, 15, "What is the value of result?");
2024
});
2125

2226
test("subtraction", function() {
2327
var result = 5;
2428
for (var i = 0; i <= 2; i++) {
25-
result = result - i;
29+
result = result - i;
2630
}
27-
equals(result, __, "What is the value of result?");
31+
32+
equals(result, 2, "What is the value of result?");
2833
});
2934

3035
test("assignment subtraction", function() {
3136
var result = 5;
3237
for (var i = 0; i <= 2; i++) {
3338
result -= i;
3439
}
35-
equals(result, __, "What is the value of result?");
40+
equals(result, 2, "What is the value of result?");
3641
});
3742

3843
//Assignment operators are available for multiplication and division as well
@@ -43,5 +48,5 @@ test("modulus", function() {
4348
var x = 5;
4449
//again this is exactly the same as result = result % x
4550
result %= x;
46-
equals(result, __, "What is the value of result?");
51+
equals(result, 0, "What is the value of result?");
4752
});

topics/about_reflection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ test("hasOwnProperty", function() {
3737
keys.push(propertyName);
3838
}
3939
equals(keys.length, __, 'how many elements are in the keys array?');
40-
deepEqual(keys, [__, __], 'what are the properties of the array?');
40+
ok(keys.equalTo([__, __]), 'what are the properties of the array?');
4141

4242
// hasOwnProperty returns true if the parameter is a property directly on the object,
4343
// but not if it is a property accessible via the prototype chain.
@@ -48,7 +48,7 @@ test("hasOwnProperty", function() {
4848
}
4949
}
5050
equals(ownKeys.length, __, 'how many elements are in the ownKeys array?');
51-
deepEqual(ownKeys, [__], 'what are the own properties of the array?');
51+
ok(ownKeys.equalTo([__, __]), 'what are the own properties of the array?');
5252
});
5353

5454
test("constructor property", function () {

topics/about_scope.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
module("About Scope (topics/about_scope.js)");
23

34
thisIsAGlobalVariable = 77;
@@ -17,5 +18,5 @@ test("variables declared inside of a function", function() {
1718
})();
1819

1920
equals(outerVariable, __, 'is outerVariable defined in this scope?');
20-
equals(typeof(innerVariable), __, 'is innerVariable defined in this scope?');
21+
equals(typeof(innerVariable), "undefined", 'is innerVariable defined in this scope?');
2122
});

0 commit comments

Comments
 (0)