Passed
Pull Request — master (#35)
by Pieter Epeüs
01:40
created

test/arr.js   A

Complexity

Total Complexity 8
Complexity/F 1

Size

Lines of Code 30
Function Count 8

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 8
eloc 16
mnd 0
bc 0
fnc 8
dl 0
loc 30
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 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