1 import shallowEqual from './shallowEqual';
3 describe('shallowEqual()', () => {
4 it('returns true when comparing 2 empty arrays', () => {
5 const result = shallowEqual([], []);
7 expect(result).toBe(true);
10 it('returns true if arrays contain the same items', () => {
11 const result = shallowEqual(['item 0', 'item 1', 'item 2'], ['item 0', 'item 1', 'item 2']);
13 expect(result).toBe(true);
16 it('returns false if arrays are different lengths', () => {
17 const result = shallowEqual([], ['item 0']);
19 expect(result).toBe(false);
22 it('returns false if arrays contain different items', () => {
23 const result = shallowEqual(['item 0', 'item 1', 'item 2'], ['item 0', 'DIFFERENT item 1', 'item 2']);
25 expect(result).toBe(false);