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

test/intersect.js   A

Complexity

Total Complexity 5
Complexity/F 1

Size

Lines of Code 19
Function Count 5

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 11
mnd 0
bc 0
fnc 5
dl 0
loc 19
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
1
import { Arr } from '../src/helpers';
2
3
const a = new Arr(['John', 'Peter', 'Luke']);
4
const b = ['Peter', 'Luke', 'Paul'];
5
const c = ['Luke', 'Paul', 'John'];
6
7
describe('Intersect', () => {
8
    describe('One side', () => {
9
        it('Should return the intersect, in this example should it be Peter and Luke.', () => {
10
            expect(['Peter', 'Luke']).toEqual(a.intersect(b));
11
        });
12
    });
13
14
    describe('Average both sides', () => {
15
        it('Should return the intersect of more than 2 arrays, in this example should it be Luke.', () => {
16
            expect(['Luke']).toEqual(a.intersect([b, c], true));
17
        });
18
    });
19
});
20