Passed
Push — master ( 6c3603...8c31e5 )
by Pieter Epeüs
01:48 queued 12s
created

src/__tests__/parse-all.spec.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 22
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 15
mnd 0
bc 0
fnc 2
dl 0
loc 22
rs 10
bpm 0
cpm 1
noi 4
c 0
b 0
f 0
1
import { expect, describe, it } from '@jest/globals';
2
import Obj from '../objects.js';
3
4
const schema = {
5
    sku: Number
0 ignored issues
show
introduced by
Insert ,
Loading history...
6
}
0 ignored issues
show
introduced by
Insert ;
Loading history...
7
const ObjectWithSchema = Obj({ schema });
8
9
describe('Test parseAll', () => {
10
    it('It should parse the object for all items', () => {
11
        const data = [
0 ignored issues
show
introduced by
Replace ... with {·sku:·'123'·},·{·sku:·'124'·}];
Loading history...
12
            { sku: '123' },
13
            { sku: '124' },
14
        ]
15
        const result = ObjectWithSchema.parseAll(data);
16
        const expected = [
0 ignored issues
show
introduced by
Replace ... with {·sku:·123·},·{·sku:·124·}];
Loading history...
17
            { sku: 123 },
18
            { sku: 124 },
19
        ]
20
        expect(result).toEqual(expected);
21
    });
22
});
23