diff --git a/tests/methods.spec.ts b/tests/methods.spec.ts new file mode 100644 index 0000000..9155a8d --- /dev/null +++ b/tests/methods.spec.ts @@ -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); + }); +});