mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2025-12-19 08:59:05 +08:00
Avoid using toBeTruthy() and toBeFalsy() because of type coercion.
This commit is contained in:
@@ -44,11 +44,11 @@ describe('Queue', () => {
|
||||
it('should check if queue is empty', () => {
|
||||
const queue = new Queue();
|
||||
|
||||
expect(queue.isEmpty()).toBeTruthy();
|
||||
expect(queue.isEmpty()).toBe(true);
|
||||
|
||||
queue.enqueue(1);
|
||||
|
||||
expect(queue.isEmpty()).toBeFalsy();
|
||||
expect(queue.isEmpty()).toBe(false);
|
||||
});
|
||||
|
||||
it('should dequeue from queue in FIFO order', () => {
|
||||
@@ -60,6 +60,6 @@ describe('Queue', () => {
|
||||
expect(queue.dequeue()).toBe(1);
|
||||
expect(queue.dequeue()).toBe(2);
|
||||
expect(queue.dequeue()).toBeNull();
|
||||
expect(queue.isEmpty()).toBeTruthy();
|
||||
expect(queue.isEmpty()).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user