Skip to content

Instantly share code, notes, and snippets.

@ibrahimBanat
Created June 20, 2021 22:39
Show Gist options
  • Save ibrahimBanat/8cef3822ea90970b07b169c93a870de9 to your computer and use it in GitHub Desktop.
Save ibrahimBanat/8cef3822ea90970b07b169c93a870de9 to your computer and use it in GitHub Desktop.
"use strict";
const insertionSort = require("../insertionSort");
describe("insertion sort testing", () => {
it("should sucessfully return sorted array", () => {
//arrange
let array = [8, 4, 23, 42, 16, 15];
//act
let sorted = insertionSort(array);
//assert
expect(sorted.length).toEqual(6);
expect(sorted[0]).toEqual(4);
expect(sorted).toEqual([4, 8, 15, 16, 23, 42]);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment