Skip to content

Commit

Permalink
test(heap): add tests for is empty methods
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledosama999 committed Mar 5, 2021
1 parent 5305000 commit 6f12d61
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/methods.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* eslint-disable no-constant-condition */
/* eslint-disable no-cond-assign */
import { expect } from 'chai';
import { MaxHeap } from '../src/index';

describe('Methods', () => {
it('the isEmpty method works', () => {
const maxHeap = new MaxHeap((x) => x);
maxHeap.insertMany([1].values());

expect(maxHeap.isEmpty()).to.eq(false);

maxHeap.pop();
expect(maxHeap.isEmpty()).to.eq(true);
});
});

0 comments on commit 6f12d61

Please sign in to comment.