| 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', 'Peter'], |
||
| 7 | test2: ['John', 'Peter', 'Luke', 'Paul'], |
||
| 8 | test3: ['John', 'Peter', 'Luke', 'Paul'], |
||
| 9 | }; |
||
| 10 | |||
| 11 | describe('Push if not exists', () => { |
||
| 12 | describe('Test 1', () => { |
||
| 13 | it('Should be return 2 item in the array.', () => { |
||
| 14 | a.pushMultipleIfNotExists(['John', 'Peter']); |
||
| 15 | expect(expectedResults.test1).toEqual(a); |
||
| 16 | }); |
||
| 17 | }); |
||
| 18 | |||
| 19 | describe('Test 2', () => { |
||
| 20 | it('Should be return 4 item in the array.', () => { |
||
| 21 | a.pushMultipleIfNotExists(['Luke', 'Paul']); |
||
| 22 | expect(expectedResults.test2).toEqual(a); |
||
| 23 | }); |
||
| 24 | }); |
||
| 25 | |||
| 26 | describe('Test 3', () => { |
||
| 27 | it('Should be return 4 item in the array.', () => { |
||
| 28 | a.pushMultipleIfNotExists(['John', 'Peter']); |
||
| 29 | expect(expectedResults.test3).toEqual(a); |
||
| 30 | }); |
||
| 31 | }); |
||
| 32 | }); |
||
| 33 |