mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2026-03-13 08:51:02 +08:00
Refactor Heaps.
This commit is contained in:
12
src/data-structures/heap/__test__/Heap.test.js
Normal file
12
src/data-structures/heap/__test__/Heap.test.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import Heap from '../Heap';
|
||||
|
||||
describe('Heap', () => {
|
||||
it('should not allow to create instance of the Heap directly', () => {
|
||||
const instantiateHeap = () => {
|
||||
const heap = new Heap();
|
||||
heap.add(5);
|
||||
};
|
||||
|
||||
expect(instantiateHeap).toThrow();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user