Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Commit

Permalink
Add test for array reorder util
Browse files Browse the repository at this point in the history
  • Loading branch information
Ray Foo authored and busyxiang committed Aug 26, 2022
1 parent 3ee4dfe commit a6bb60f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/plenty-lizards-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@busyxiang/utilities-js': patch
---

Add test for array reorder util
11 changes: 11 additions & 0 deletions src/array.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { reorder } from './array';

describe('reorder', () => {
test('it should return a new copy of reorder array', () => {
const arr = ['first', 'second', 'third'];

const reordered = reorder(arr, 2, 0);

expect(reordered).toEqual(['third', 'first', 'second']);
});
});

0 comments on commit a6bb60f

Please sign in to comment.