test/utils/helpers/numbers.test.js   A
last analyzed

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 20
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 13
mnd 0
bc 0
fnc 4
dl 0
loc 20
rs 10
bpm 0
cpm 1
noi 1
c 0
b 0
f 0
1
import { roundTen } from '../../../src/utils/helpers/numbers';
2
3
describe('numbers', () => {
4
  describe('roundTen', () => {
5
    it('rounds provided number to the next multiple of ten', () => {
6
      const expectationsPairs = [
7
        [ 10, 10 ],
8
        [ 12, 20 ],
9
        [ 158, 160 ],
10
        [ 5, 10 ],
11
        [ -42, -40 ],
12
      ];
13
14
      expect.assertions(expectationsPairs.length);
0 ignored issues
show
Bug introduced by
The variable expect seems to be never declared. If this is a global, consider adding a /** global: expect */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
15
      expectationsPairs.forEach(([ number, expected ]) => {
16
        expect(roundTen(number)).toEqual(expected);
17
      });
18
    });
19
  });
20
});
21