aboutsummaryrefslogtreecommitdiffstats
path: root/test/helpers/array-helpers.test.ts
blob: 662d6b8285fa3bd322e21a45b4bcc06ce3b82885 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import shuffleArray from '../../src/helpers/array-helpers';

describe('array_helpers', () => {
  it('isValidExternalURL', () => {
    const originalArray = ['a', 'b', 'c'];
    const shuffledArray = shuffleArray(originalArray);

    // Expect the arrays to be exactly the same
    // when both are sorted alphabetically
    // eslint-disable-next-line sonar/no-alphabetical-sort
    expect(shuffledArray.sort()).toEqual(originalArray.sort());
  });
});