1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-11-01 19:07:38 +01:00
unleash.unleash/src/lib/util/arraysHaveSameItems.test.ts

18 lines
909 B
TypeScript
Raw Normal View History

import { arraysHaveSameItems } from './arraysHaveSameItems';
test('arraysHaveSameItems', () => {
expect(arraysHaveSameItems([], [])).toEqual(true);
expect(arraysHaveSameItems([1], [1])).toEqual(true);
expect(arraysHaveSameItems([1], [1, 1])).toEqual(true);
expect(arraysHaveSameItems([1, 1], [1])).toEqual(true);
expect(arraysHaveSameItems([1, 2], [1, 2])).toEqual(true);
expect(arraysHaveSameItems([1, 2], [2, 1])).toEqual(true);
expect(arraysHaveSameItems([1, 2], [2, 2, 1])).toEqual(true);
expect(arraysHaveSameItems([1], [])).toEqual(false);
expect(arraysHaveSameItems([1], [2])).toEqual(false);
expect(arraysHaveSameItems([1, 2], [1, 3])).toEqual(false);
expect(arraysHaveSameItems([1, 2], [1, 2, 3])).toEqual(false);
expect(arraysHaveSameItems([1, 2, 3], [1, 2])).toEqual(false);
expect(arraysHaveSameItems([1, 2, 3], [1, 2, 4])).toEqual(false);
});