mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2026-03-13 08:51:02 +08:00
Avoid using toBeTruthy() and toBeFalsy() because of type coercion.
This commit is contained in:
@@ -7,14 +7,14 @@ describe('MinHeap', () => {
|
||||
|
||||
expect(minHeap).toBeDefined();
|
||||
expect(minHeap.peek()).toBeNull();
|
||||
expect(minHeap.isEmpty()).toBeTruthy();
|
||||
expect(minHeap.isEmpty()).toBe(true);
|
||||
});
|
||||
|
||||
it('should add items to the heap and heapify it up', () => {
|
||||
const minHeap = new MinHeap();
|
||||
|
||||
minHeap.add(5);
|
||||
expect(minHeap.isEmpty()).toBeFalsy();
|
||||
expect(minHeap.isEmpty()).toBe(false);
|
||||
expect(minHeap.peek()).toBe(5);
|
||||
expect(minHeap.toString()).toBe('5');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user