Passed
Push — master ( 09a54a...cba1d2 )
by Muhammad Dyas
01:26
created

tests/utils.test.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 13
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 7
mnd 0
bc 0
fnc 1
dl 0
loc 13
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
1
import {getRandomWinners} from '../src/helpers/utils.js';
2
3
test('get the winner', () => {
4
  const names = ['Ibrahim', 'Isa', 'Moses', 'Ismail'];
5
6
  const winners = getRandomWinners(names);
7
8
  expect(winners.length).toEqual(1);
9
10
  const winners2 = getRandomWinners(names, 2);
11
12
  expect(winners2.length).toEqual(2);
13
});
14