Total Complexity | 2 |
Complexity/F | 1 |
Lines of Code | 27 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | /* eslint-disable no-new */ |
||
2 | import { expect, describe, it } from '@jest/globals'; |
||
3 | import Parser from '../parser'; |
||
4 | |||
5 | const testSchema = { |
||
6 | a: Number, |
||
7 | b: Boolean, |
||
8 | 'c?': String, |
||
9 | }; |
||
10 | |||
11 | describe('Test parser.js', () => { |
||
12 | it('It should parse the values', () => { |
||
13 | const input = { |
||
14 | a: '42', |
||
15 | b: '1', |
||
16 | c: 42, |
||
17 | d: 'test', |
||
18 | }; |
||
19 | const parse = new Parser({ schema: testSchema }); |
||
20 | |||
21 | expect(parse.parseObject(input)).toEqual({ |
||
22 | a: 42, |
||
23 | b: true, |
||
24 | c: '42', |
||
25 | d: 'test', |
||
26 | }); |
||
27 | }); |
||
28 | }); |
||
29 |