From df9e121ef5e6a5ece2e52eb4bc6c1e3eb276e33a Mon Sep 17 00:00:00 2001 From: Alec Larson <1925840+aleclarson@users.noreply.github.com> Date: Fri, 5 Jul 2024 00:38:42 -0400 Subject: [PATCH] chore: format --- src/random/shuffle.ts | 6 +----- tests/random/shuffle.test.ts | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/random/shuffle.ts b/src/random/shuffle.ts index 4e383ec9..de385598 100644 --- a/src/random/shuffle.ts +++ b/src/random/shuffle.ts @@ -5,11 +5,7 @@ export function shuffle( random: (min: number, max: number) => number = _.random, ): T[] { const newArray = array.slice() - for ( - let idx = 0, randomIdx: number, item: T; - idx < array.length; - idx++ - ) { + for (let idx = 0, randomIdx: number, item: T; idx < array.length; idx++) { randomIdx = random(0, array.length - 1) item = newArray[randomIdx] newArray[randomIdx] = newArray[idx] diff --git a/tests/random/shuffle.test.ts b/tests/random/shuffle.test.ts index 18e6dc90..c89f00e1 100644 --- a/tests/random/shuffle.test.ts +++ b/tests/random/shuffle.test.ts @@ -23,7 +23,7 @@ describe('shuffle', () => { const list = [1, 2, 3, 4, 5] const mockRandom = vi.fn(() => 1) const result = _.shuffle(list, mockRandom) - + expect(mockRandom).toHaveBeenCalled() expect(result).not.toEqual(list) expect(result.length).toBe(list.length)