Skip to content

Commit

Permalink
Add basic unit tests for ints, phase 2
Browse files Browse the repository at this point in the history
  • Loading branch information
gendelbendel committed May 9, 2023
1 parent a0874e2 commit 39edcca
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions test/specs/unit/util.unit.js
Expand Up @@ -3,6 +3,28 @@ const { expect } = require('chai');
const util = require('../../../lib/util');

describe('util.js', () => {
context('isSortedHiToLow()', () => {});
context('isSortedLowToHi()', () => {});
context('isSortedHiToLow()', () => {
it('returns false when list is ascending', () => {
const list = [123, 456];
const result = util.isSortedHiToLow(list);
expect(result).to.equal(false);
});
it('returns true when list is descending', () => {
const list = [456, 123];
const result = util.isSortedHiToLow(list);
expect(result).to.equal(true);
});
});
context('isSortedLowToHi()', () => {
it('returns true when list is ascending', () => {
const list = [123, 456];
const result = util.isSortedLowToHi(list);
expect(result).to.equal(true);
});
it('returns false when list is descending', () => {
const list = [456, 123];
const result = util.isSortedLowToHi(list);
expect(result).to.equal(false);
});
});
});

0 comments on commit 39edcca

Please sign in to comment.