Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should not shift to negative index', () => {
const res = arrayShift('flat', 0)(fields);
expect(res['flat.-1']).toBeUndefined();
expect(res['flat.0']).toBe(field1);
expect(res['flat.1']).toBe(field2);
expect(res['flat.2']).toBe(field3);
expect(res['flat.3']).toBe(field4);
});