Total Complexity | 7 |
Complexity/F | 1 |
Lines of Code | 32 |
Function Count | 7 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { Arr } from '../src/helpers'; |
||
2 | |||
3 | const a = new Arr(); |
||
4 | |||
5 | const expectedResults = { |
||
6 | test1: ['John'], |
||
7 | test2: ['John', 'Peter'], |
||
8 | test3: ['John', 'Peter'], |
||
9 | }; |
||
10 | |||
11 | describe('Push if not exists', () => { |
||
12 | describe('Test 1', () => { |
||
13 | it('Should be return 1 item in the array.', () => { |
||
14 | a.pushIfNotExists('John'); |
||
15 | expect(a).toEqual(expectedResults.test1); |
||
16 | }); |
||
17 | }); |
||
18 | |||
19 | describe('Test 2', () => { |
||
20 | it('Should be return 2 item in the array.', () => { |
||
21 | a.pushIfNotExists('Peter'); |
||
22 | expect(a).toEqual(expectedResults.test2); |
||
23 | }); |
||
24 | }); |
||
25 | |||
26 | describe('Test 3', () => { |
||
27 | it('Should be return 2 item in the array.', () => { |
||
28 | a.pushIfNotExists('John'); |
||
29 | expect(a).toEqual(expectedResults.test3); |
||
30 | }); |
||
31 | }); |
||
32 | }); |
||
33 |