Example #1
0
 it('should return an empty array when target branch is not enumerable', () => {
   expect(getDeepJsonChildren(json, 'testString')).to.deep.equal([]);
   expect(getDeepJsonChildren(json, 'testShallow')).to.deep.equal([]);
 });
Example #2
0
 it('should return an indices when target branch is an array', () => {
   expect(getDeepJsonChildren(json, 'testDeep.testDeeper')).to.deep.equal([ '0' ]);
 });
Example #3
0
 it('should return an empty array when branch is not found', () => {
   expect(getDeepJsonChildren(json, 'testWrongBranch')).to.deep.equal([]);
 });
Example #4
0
 it('should return json branch keys', () => {
   expect(getDeepJsonChildren(json, 'testDeep')).to.deep.equal([ 'testDeeper' ]);
 });
Example #5
0
 it('should return root json keys when not given any path', () => {
   expect(getDeepJsonChildren(json)).to.deep.equal([ 'testShallow', 'testString', 'testDeep' ]);
 });
Example #6
0
 it('should return an empty array of children if given no arguments', () => {
   expect(getDeepJsonChildren()).to.deep.equal([]);
 });