Skip to content
This repository was archived by the owner on Mar 27, 2022. It is now read-only.

Commit d0ad83b

Browse files
committed
feat(test): ✅ add test for bubble sort
1 parent 2b36d27 commit d0ad83b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

__tests__/bubbleSort.spec.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { bubbleSort } from '../src/bubbleSort';
2+
import { compareNumbers } from '../src/compareNumbers';
3+
4+
describe('Bubble sort', () => {
5+
it('Sort array of numbers', () => {
6+
const ARRAY = [2, 1, 4, 5, 7, 12, 0];
7+
const SORTED_ARRAY = [0, 1, 2, 4, 5, 7, 12];
8+
9+
expect(bubbleSort(ARRAY, compareNumbers)).toEqual(SORTED_ARRAY);
10+
})
11+
})

0 commit comments

Comments
 (0)