UNPKG

lets-sort-array

Version:

Help to arrange an array in a desired sequence

36 lines (20 loc) 767 B
import assert from 'assert'; import { Sort } from '../src/main.mjs'; describe('Sorting test began ...', function () { describe('testing in ascending order', function () { it('Should exactly match all elements: ', function () { let myTestingArray = [0, 13, 1, 9] let result = Sort(myTestingArray, 'ASC') let myExpectedResult = [0, 1, 9, 13] assert.deepStrictEqual(myExpectedResult, result) }); }); describe('testing in descending order', function () { it('Should exactly match all elements:', function () { let myTestingArray = [0, 13, 1, 9] let result = Sort(myTestingArray, 'DESC') let myExpectedResult = [13, 9, 1, 0] assert.deepStrictEqual(myExpectedResult, result) }); }); })