fix multiple agg functions handling, closes #530

This commit is contained in:
Alexander Zobnin
2019-03-07 10:35:36 +03:00
parent 3428137f7c
commit e4bbecb18b
4 changed files with 52 additions and 4 deletions

View File

@@ -138,4 +138,31 @@ describe('Utils', () => {
done();
});
});
describe('getArrayDepth()', () => {
it('should calculate proper array depth', () => {
const test_cases = [
{
array: [],
depth: 1
},
{
array: [1, 2, 3],
depth: 1
},
{
array: [[1, 2], [3, 4]],
depth: 2
},
{
array: [ [[1, 2], [3, 4]], [[1, 2], [3, 4]] ],
depth: 3
},
];
for (const test_case of test_cases) {
expect(utils.getArrayDepth(test_case.array)).toBe(test_case.depth);
}
});
});
});