forked from Workintech/FSWeb-S2G1-Scope-ve-Closure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codegrade_mvp1.test.js
38 lines (30 loc) · 937 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 takimSkoru = function() {
return Math.floor(Math.random() * 16+10);
}
describe('asFunction', ()=>{
it('as returns sa', ()=>{
expect(functions.sa()).toBe('as');
})
});
describe('takimSkoru', ()=>{
it('takimSkoru returns a random number', ()=>{
expect(functions.takimSkoru()).toBeLessThanOrEqual(25);
})
});
describe('macSonucu', ()=>{
it('macSonucu returns an object', ()=>{
expect(functions.macSonucu(takimSkoru, 4)).toEqual(expect.objectContaining({
EvSahibi: expect.any(Number),
KonukTakim: expect.any(Number),
}))
})
});
describe('periyotSkoru', ()=>{
it('periyotSkoru returns an object', ()=>{
expect(functions.periyotSkoru(takimSkoru)).toEqual(expect.objectContaining({
EvSahibi: expect.any(Number),
KonukTakim: expect.any(Number),
}));
});
});