Avoid using toBeTruthy() and toBeFalsy() because of type coercion.

This commit is contained in:
Oleksii Trekhleb
2018-07-26 16:14:26 +03:00
parent 8da83cd9dc
commit 39acb2b65d
25 changed files with 367 additions and 367 deletions

View File

@@ -31,11 +31,11 @@ describe('Stack', () => {
it('should check if stack is empty', () => {
const stack = new Stack();
expect(stack.isEmpty()).toBeTruthy();
expect(stack.isEmpty()).toBe(true);
stack.push(1);
expect(stack.isEmpty()).toBeFalsy();
expect(stack.isEmpty()).toBe(false);
});
it('should pop data from stack', () => {
@@ -47,7 +47,7 @@ describe('Stack', () => {
expect(stack.pop()).toBe(2);
expect(stack.pop()).toBe(1);
expect(stack.pop()).toBeNull();
expect(stack.isEmpty()).toBeTruthy();
expect(stack.isEmpty()).toBe(true);
});
it('should be possible to push/pop objects', () => {