File size: 465 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import isKey from '../../utils/isKey';

describe('isKey', () => {
  it('should return true when it is not a deep key', () => {
    expect(isKey('test')).toBeTruthy();
    expect(isKey('fooBar')).toBeTruthy();
  });

  it('should return false when it is a deep key', () => {
    expect(isKey('test.foo')).toBeFalsy();
    expect(isKey('test.foo[0]')).toBeFalsy();
    expect(isKey('test[1]')).toBeFalsy();
    expect(isKey('test.foo[0].bar')).toBeFalsy();
  });
});