OLD | NEW |
| (Empty) |
1 This test checks the behavior of the every() method on Array objects. | |
2 | |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | |
4 | |
5 | |
6 1.0 Single Argument Testing | |
7 PASS [12, 5, 8, 130, 44].every(isBigEnough) is false | |
8 PASS [12, 54, 18, 130, 44].every(isBigEnough) is true | |
9 | |
10 2.0 Two Argument Testing | |
11 PASS [12, 5, 10, 130, 44].every(isBigEnough, predicate) is false | |
12 PASS [12, 54, 18, 130, 44].every(isBigEnough, predicate) is true | |
13 | |
14 3.0 Array Mutation Tests | |
15 | |
16 3.1 Array Element Removal | |
17 PASS [12, 5, 8, 130, 44].every(isBigEnoughAndPop) is false | |
18 PASS [12, 54, 18, 130, 44].every(isBigEnoughAndPop) is true | |
19 | |
20 3.2 Array Element Changing | |
21 PASS [12, 5, 8, 130, 44].every(isBigEnoughAndChange) is false | |
22 PASS [12, 54, 18, 130, 44].every(isBigEnoughAndChange) is false | |
23 | |
24 3.3 Array Element Addition | |
25 PASS [12, 5, 8, 130, 44].every(isBigEnoughAndPush) is false | |
26 PASS [12, 54, 18, 130, 44].every(isBigEnoughAndPush) is false | |
27 | |
28 4.0 Exception Test | |
29 PASS [12, 5, 8, 130, 44].every(isBigEnoughAndException) threw exception exceptio
n from function. | |
30 PASS [12, 54, 18, 130, 44].every(isBigEnoughAndException) threw exception except
ion from function. | |
31 | |
32 5.0 Wrong Type for Callback Test | |
33 PASS [12, 5, 8, 130, 44].every(5) threw exception TypeError: Type error. | |
34 PASS [12, 5, 8, 130, 44].every('wrong') threw exception TypeError: Type error. | |
35 PASS [12, 5, 8, 130, 44].every(new Object()) threw exception TypeError: Type err
or. | |
36 PASS [12, 5, 8, 130, 44].every(null) threw exception TypeError: Type error. | |
37 PASS [12, 5, 8, 130, 44].every(undefined) threw exception TypeError: Type error. | |
38 PASS [12, 5, 8, 130, 44].every() threw exception TypeError: Type error. | |
39 | |
40 6.0 Early Exit ("Short Circuiting") | |
41 PASS [12, 5, 8, 130, 44].every(isBigEnoughShortCircuit) is false | |
42 PASS accumulator.toString() is [12, 5].toString() | |
43 PASS [12, 54, 18, 130, 44].every(isBigEnoughShortCircuit) is true | |
44 PASS accumulator.toString() is [12, 54, 18, 130, 44].toString() | |
45 | |
46 7.0 Behavior for Holes in Arrays | |
47 PASS arr.every(isNotUndefined) is true | |
48 PASS arr.every(isNotUndefined) is true | |
49 PASS successfullyParsed is true | |
50 | |
51 TEST COMPLETE | |
52 | |
OLD | NEW |