Skip to content

Commit

Permalink
Update, set const for findListDiffIndex. (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsomariano authored Nov 20, 2020
1 parent a6687b8 commit f1d3c57
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/util.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,27 +97,28 @@ describe('Util', () => {
});

it('diff only 1', () => {
expect(findListDiffIndex([0, 1, 2], [], num => num)).toEqual({
const indexArray = [0, 1, 2];
expect(findListDiffIndex(indexArray, [], num => num)).toEqual({
index: 0,
multiple: true,
});
expect(findListDiffIndex([0, 1, 2], [1, 2], num => num)).toEqual({
expect(findListDiffIndex(indexArray, [1, 2], num => num)).toEqual({
index: 0,
multiple: false,
});
expect(findListDiffIndex([0, 1, 2], [0, 2], num => num)).toEqual({
expect(findListDiffIndex(indexArray, [0, 2], num => num)).toEqual({
index: 1,
multiple: false,
});
expect(findListDiffIndex([0, 1, 2], [0, 1], num => num)).toEqual({
expect(findListDiffIndex(indexArray, [0, 1], num => num)).toEqual({
index: 2,
multiple: false,
});
expect(findListDiffIndex([0, 1, 2], [0], num => num)).toEqual({
expect(findListDiffIndex(indexArray, [0], num => num)).toEqual({
index: 1,
multiple: true,
});
expect(findListDiffIndex([0, 1, 2], [1], num => num)).toEqual({
expect(findListDiffIndex(indexArray, [1], num => num)).toEqual({
index: 0,
multiple: true,
});
Expand Down

1 comment on commit f1d3c57

@vercel
Copy link

@vercel vercel bot commented on f1d3c57 Nov 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.