Total Complexity | 2 |
Complexity/F | 1 |
Lines of Code | 22 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { expect, describe, it } from '@jest/globals'; |
||
2 | import Obj from '../objects.js'; |
||
3 | |||
4 | const schema = { |
||
5 | sku: Number |
||
|
|||
6 | } |
||
7 | const ObjectWithSchema = Obj({ schema }); |
||
8 | |||
9 | describe('Test parseAll', () => { |
||
10 | it('It should parse the object for all items', () => { |
||
11 | const data = [ |
||
12 | { sku: '123' }, |
||
13 | { sku: '124' }, |
||
14 | ] |
||
15 | const result = ObjectWithSchema.parseAll(data); |
||
16 | const expected = [ |
||
17 | { sku: 123 }, |
||
18 | { sku: 124 }, |
||
19 | ] |
||
20 | expect(result).toEqual(expected); |
||
21 | }); |
||
22 | }); |
||
23 |