UNPKG

sorting-lib

Version:

A library that makes sorting easier by introducing `Comparator`

26 lines (25 loc) 1.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var primitive_comparators_1 = require("./primitive-comparators"); describe('primitive comparators', function () { it('should compare numbers', function () { expect((0, primitive_comparators_1.comparePrimitive)(2, 1)) .toBeGreaterThan(0); }); it('should compare strings alphabetically', function () { expect((0, primitive_comparators_1.comparePrimitive)('b', 'a')) .toBeGreaterThan(0); }); it('should compare strings locally', function () { expect((0, primitive_comparators_1.comparePrimitive)('b', 'a')) .toBeGreaterThan(0); }); it('should compare dates', function () { expect((0, primitive_comparators_1.comparePrimitive)(new Date('2021/01/02'), new Date('2021/01/01'))) .toBeGreaterThan(0); }); it('should compare booleans', function () { expect((0, primitive_comparators_1.comparePrimitive)(true, false)) .toBeGreaterThan(0); }); });