Total Complexity | 2 |
Complexity/F | 1 |
Lines of Code | 16 |
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 = [{ sku: '123' }, { sku: '124' }]; |
||
12 | const result = ObjectWithSchema.parseAll(data); |
||
13 | const expected = [{ sku: 123 }, { sku: 124 }]; |
||
14 | expect(result).toEqual(expected); |
||
15 | }); |
||
16 | }); |
||
17 |