-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathSpec.js
More file actions
73 lines (54 loc) · 1.62 KB
/
Copy pathSpec.js
File metadata and controls
73 lines (54 loc) · 1.62 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
describe("Data Types, Operators, & Expressions", function() {
it("should return true", function(){
expect(answers[0]).to.eql(true);
});
it("should return true", function(){
expect(answers[1]).to.eql(true);
});
it("should return true", function(){
expect(answers[2]).to.eql(true);
});
it("should return true", function(){
expect(answers[3]).to.eql(true);
});
it("should return true", function(){
expect(answers[4]).to.eql(true);
});
it("should return true", function(){
expect(answers[5]).to.eql(true);
});
it("should return true", function(){
expect(answers[6]).to.eql(true);
});
it("should return true", function(){
expect(answers[7]).to.eql(true);
});
});
describe("Basic Functions", function() {
it("should add 2 things", function() {
expect(addition(2, 2)).to.eql(4);
});
it("should add 3 things", function() {
expect(addition(2, 3, 4)).to.eql(9);
});
it("should include a conditional statement", function() {
expect(fun_with_math(2, 2)).to.eql(4);
});
it("should do something different with odd numbers", function() {
expect(fun_with_math(3, 3)).to.eql(9);
})
});
describe("Higher Order Function", function() {
it("should multiple numbers in an array", function() {
var test_array = [1, 2, 3, 4, 5];
expect(ForEach(test_array, function(item) {
item = item * 2;
})).to.eql([2, 4, 6, 8, 10]);
});
it("should add y to all the strings", function() {
var test_array = ['cat', 'bat', 'hat'];
expect(ForEach(test_array, function(item) {
item = item + 'y';
})).to.eql(['caty', 'baty', 'haty']);
});
});