-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.test.js
More file actions
86 lines (79 loc) · 2.53 KB
/
Copy pathindex.test.js
File metadata and controls
86 lines (79 loc) · 2.53 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
74
75
76
77
78
79
80
81
82
83
84
import functions from '../index';
describe('fooFunction', ()=>{
it('foo returns foo', ()=>{
expect(functions.foo()).toBe('bar');
})
});
describe('multiplyFunction', ()=>{
it('a * b', ()=>{
expect(functions.multiply(5, 7)).toBe(35);
})
});
describe('dogYearsFunction', ()=>{
it('returns humanYears * 7', ()=>{
expect(functions.dogYears(5)).toBe(35);
})
});
describe('hungryDogFunction', ()=>{
it('returns weight * x based on age and weight', ()=>{
expect(functions.hungryDog(15, 1)).toBe(0.44999999999999996);
})
});
describe('gameFunction', ()=>{
it('return win, lose or tie', ()=>{
expect(functions.game('rock', 'scissors')).toBe('you win!');
})
it('return win, lose or tie', ()=>{
expect(functions.game('rock', 'paper')).toBe('you lose!');
})
it('return win, lose or tie', ()=>{
expect(functions.game('rock', 'rock')).toBe(`it's a tie`);
})
it('return win, lose or tie', ()=>{
expect(functions.game('paper', 'rock')).toBe(`you win!`);
})
it('return win, lose or tie', ()=>{
expect(functions.game('paper', 'scissors')).toBe(`you lose!`);
})
it('return win, lose or tie', ()=>{
expect(functions.game('paper', 'paper')).toBe(`it's a tie`);
})
it('return win, lose or tie', ()=>{
expect(functions.game('scissors', 'paper')).toBe(`you win!`);
})
it('return win, lose or tie', ()=>{
expect(functions.game('scissors', 'rock')).toBe(`you lose!`);
})
});
describe('milesFunction', ()=>{
it('return km * 0.621371', ()=>{
expect(functions.miles(10)).toBe(6.21371);
})
});
describe('feetFunction', ()=>{
it('return cm / 30.48', ()=>{
expect(functions.feet(160)).toBe(5.2493438320209975);
})
});
describe('annoyingSongFunction', ()=>{
it('a string that counts down based on the number imputted', ()=>{
expect(functions.annoyingSong(5)).toBe(`${5} bottles of soda on the wall, ${5} bottles of soda, take one down pass it around ${5 - 1} bottles of soda on the wall`);
})
});
describe('gradeFunction', ()=>{
it('expect A', ()=>{
expect(functions.grade(90)).toBe('you got an A');
})
it('expect B', ()=>{
expect(functions.grade(80)).toBe('you got a B');
})
it('expect C', ()=>{
expect(functions.grade(70)).toBe('you got a C');
})
it('expect D', ()=>{
expect(functions.grade(60)).toBe('you got a D');
})
it('expect F', ()=>{
expect(functions.grade(59)).toBe('you got an F');
})
});