-
Notifications
You must be signed in to change notification settings - Fork 0
/
codegrade_mvp1.test.js
38 lines (30 loc) · 914 Bytes
/
codegrade_mvp1.test.js
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
import functions from './index';
const inning = function() {
return Math.floor(Math.random() * Math.floor(3));
}
describe('fooFunction', ()=>{
it('foo returns foo', ()=>{
expect(functions.foo()).toBe('bar');
})
});
describe('inning', ()=>{
it('inning returns a random number', ()=>{
expect(functions.inning()).toBeLessThanOrEqual(2);
})
});
describe('finalScore', ()=>{
it('finalScore returns an object', ()=>{
expect(functions.finalScore(inning, 9)).toEqual(expect.objectContaining({
Home: expect.any(Number),
Away: expect.any(Number),
}))
})
});
describe('getInningScore', ()=>{
it('getInningScore returns an object', ()=>{
expect(functions.getInningScore(inning)).toEqual(expect.objectContaining({
Home: expect.any(Number),
Away: expect.any(Number),
}));
});
});