-
Notifications
You must be signed in to change notification settings - Fork 0
/
sorting.test.js
28 lines (25 loc) 路 871 Bytes
/
sorting.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { bubbleSort, quickSort, mergeSort } from "./sorting";
describe("Bubble sort", () => {
test("Bubble sort", () => {
expect(bubbleSort([4, -5, -4, 1, 7])).toStrictEqual([-5, -4, 1, 4, 7]);
});
test("BUbble sort", () => {
expect(bubbleSort([4, 2, 6, 4, 3])).toStrictEqual([2, 3, 4, 4, 6]);
});
});
describe("Quick sort", () => {
test("Quick sort", () => {
expect(quickSort([4, -5, -4, 1, 7])).toStrictEqual([-5, -4, 1, 4, 7]);
});
test("Quick sort", () => {
expect(quickSort([4, 2, 6, 4, 3])).toStrictEqual([2, 3, 4, 4, 6]);
});
});
describe("Merge sort", () => {
test("Merge sort", () => {
expect(mergeSort([4, -5, -4, 1, 7])).toStrictEqual([-5, -4, 1, 4, 7]);
});
test("Merge sort", () => {
expect(mergeSort([4, 2, 6, 4, 3])).toStrictEqual([2, 3, 4, 4, 6]);
});
});