Total Complexity | 3 |
Complexity/F | 1 |
Lines of Code | 22 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { assert } from 'chai'; |
||
2 | import { cleanUndefined } from '../../entry'; |
||
3 | import { FunctionTester } from '../../utils'; |
||
4 | |||
5 | const tester = new FunctionTester(cleanUndefined); |
||
6 | |||
7 | suite('object: cleanUndefined'); |
||
8 | |||
9 | test('Positive: cleanUndefined @example', function () { |
||
10 | tester.test({ x: { a: null, b: undefined }, c: 0 }, { x: { a: null }, c: 0 }); |
||
11 | }); |
||
12 | |||
13 | test('Positive: cleanUndefined on circullar structure', function () { |
||
14 | const obj = { a: { b: null, c: undefined } }; |
||
15 | |||
16 | obj.a.obj = obj; |
||
17 | assert.deepEqual(cleanUndefined(obj), { a: { b: null, obj } }); |
||
18 | }); |
||
19 | |||
20 | after(async function () { |
||
21 | // console.log('after', this); |
||
22 | }); |
||
23 | |||
24 |