UNPKG

sorting-algorithms-lib

Version:

sorting-algorithms-lib is a lightweight JavaScript library that provides efficient implementations of various sorting algorithms. Whether you're learning algorithms, benchmarking performance, or building a project that requires sorting, this library has y

14 lines (11 loc) 453 B
import { selectionSort } from "../shortAlgorithms/SelectionSort"; describe("SelectionSort Algorithm", () => { test("SelectionSort should sort an array of numbers", () => { const arr = [9, 1, 4, 7]; expect(selectionSort(arr)).toEqual([1, 4, 7, 9]); }); test("SelectionSort should sort an array of strings", () => { const arr = ["c", "a", "d", "b"]; expect(selectionSort(arr)).toEqual(["a", "b", "c", "d"]); }); });