Total Complexity | 8 |
Complexity/F | 1 |
Lines of Code | 30 |
Function Count | 8 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { Arr } from '../src/helpers'; |
||
2 | |||
3 | const original = new Arr(1, 2, 3); |
||
4 | const mapped = original.map((x) => x * x); |
||
5 | |||
6 | describe('Instance', () => { |
||
7 | it('Test if the original output from Arr is a instance of Arr', () => { |
||
8 | expect(original instanceof Arr).toBeTruthy(); |
||
9 | }); |
||
10 | |||
11 | it('Test if the original output from Arr is a instance of Array', () => { |
||
12 | expect(original instanceof Array).toBeTruthy(); |
||
13 | }); |
||
14 | |||
15 | it('Test if the mappen result is a instance of Arr', () => { |
||
16 | expect(mapped instanceof Arr).toBeFalsy(); |
||
17 | }); |
||
18 | |||
19 | it('Test if the mappen result is a instance of Array', () => { |
||
20 | expect(mapped instanceof Array).toBeTruthy(); |
||
21 | }); |
||
22 | |||
23 | it('Test the original result', () => { |
||
24 | expect(original).toEqual([1, 2, 3]); |
||
25 | }); |
||
26 | |||
27 | it('Test the mapped result', () => { |
||
28 | expect(mapped).toEqual([1, 4, 9]); |
||
29 | }); |
||
30 | }); |
||
31 |