Skip to content

Commit 39acb2b

Browse files
committedJul 26, 2018
Avoid using toBeTruthy() and toBeFalsy() because of type coercion.
1 parent 8da83cd commit 39acb2b

File tree

25 files changed

+367
-367
lines changed

25 files changed

+367
-367
lines changed
 

‎src/algorithms/graph/detect-cycle/__test__/detectUndirectedCycleUsingDisjointSet.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ describe('detectUndirectedCycleUsingDisjointSet', () => {
2727
.addEdge(edgeBC)
2828
.addEdge(edgeCD);
2929

30-
expect(detectUndirectedCycleUsingDisjointSet(graph)).toBeFalsy();
30+
expect(detectUndirectedCycleUsingDisjointSet(graph)).toBe(false);
3131

3232
graph.addEdge(edgeDE);
3333

34-
expect(detectUndirectedCycleUsingDisjointSet(graph)).toBeTruthy();
34+
expect(detectUndirectedCycleUsingDisjointSet(graph)).toBe(true);
3535
});
3636
});

‎src/algorithms/math/is-power-of-two/__test__/isPowerOfTwo.test.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ import isPowerOfTwo from '../isPowerOfTwo';
22

33
describe('isPowerOfTwo', () => {
44
it('should check if the number is made by multiplying twos', () => {
5-
expect(isPowerOfTwo(-1)).toBeFalsy();
6-
expect(isPowerOfTwo(0)).toBeFalsy();
7-
expect(isPowerOfTwo(1)).toBeTruthy();
8-
expect(isPowerOfTwo(2)).toBeTruthy();
9-
expect(isPowerOfTwo(3)).toBeFalsy();
10-
expect(isPowerOfTwo(4)).toBeTruthy();
11-
expect(isPowerOfTwo(5)).toBeFalsy();
12-
expect(isPowerOfTwo(6)).toBeFalsy();
13-
expect(isPowerOfTwo(7)).toBeFalsy();
14-
expect(isPowerOfTwo(8)).toBeTruthy();
15-
expect(isPowerOfTwo(10)).toBeFalsy();
16-
expect(isPowerOfTwo(12)).toBeFalsy();
17-
expect(isPowerOfTwo(16)).toBeTruthy();
18-
expect(isPowerOfTwo(31)).toBeFalsy();
19-
expect(isPowerOfTwo(64)).toBeTruthy();
20-
expect(isPowerOfTwo(1024)).toBeTruthy();
21-
expect(isPowerOfTwo(1023)).toBeFalsy();
5+
expect(isPowerOfTwo(-1)).toBe(false);
6+
expect(isPowerOfTwo(0)).toBe(false);
7+
expect(isPowerOfTwo(1)).toBe(true);
8+
expect(isPowerOfTwo(2)).toBe(true);
9+
expect(isPowerOfTwo(3)).toBe(false);
10+
expect(isPowerOfTwo(4)).toBe(true);
11+
expect(isPowerOfTwo(5)).toBe(false);
12+
expect(isPowerOfTwo(6)).toBe(false);
13+
expect(isPowerOfTwo(7)).toBe(false);
14+
expect(isPowerOfTwo(8)).toBe(true);
15+
expect(isPowerOfTwo(10)).toBe(false);
16+
expect(isPowerOfTwo(12)).toBe(false);
17+
expect(isPowerOfTwo(16)).toBe(true);
18+
expect(isPowerOfTwo(31)).toBe(false);
19+
expect(isPowerOfTwo(64)).toBe(true);
20+
expect(isPowerOfTwo(1024)).toBe(true);
21+
expect(isPowerOfTwo(1023)).toBe(false);
2222
});
2323
});

‎src/algorithms/math/is-power-of-two/__test__/isPowerOfTwoBitwise.test.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ import isPowerOfTwoBitwise from '../isPowerOfTwoBitwise';
22

33
describe('isPowerOfTwoBitwise', () => {
44
it('should check if the number is made by multiplying twos', () => {
5-
expect(isPowerOfTwoBitwise(-1)).toBeFalsy();
6-
expect(isPowerOfTwoBitwise(0)).toBeFalsy();
7-
expect(isPowerOfTwoBitwise(1)).toBeTruthy();
8-
expect(isPowerOfTwoBitwise(2)).toBeTruthy();
9-
expect(isPowerOfTwoBitwise(3)).toBeFalsy();
10-
expect(isPowerOfTwoBitwise(4)).toBeTruthy();
11-
expect(isPowerOfTwoBitwise(5)).toBeFalsy();
12-
expect(isPowerOfTwoBitwise(6)).toBeFalsy();
13-
expect(isPowerOfTwoBitwise(7)).toBeFalsy();
14-
expect(isPowerOfTwoBitwise(8)).toBeTruthy();
15-
expect(isPowerOfTwoBitwise(10)).toBeFalsy();
16-
expect(isPowerOfTwoBitwise(12)).toBeFalsy();
17-
expect(isPowerOfTwoBitwise(16)).toBeTruthy();
18-
expect(isPowerOfTwoBitwise(31)).toBeFalsy();
19-
expect(isPowerOfTwoBitwise(64)).toBeTruthy();
20-
expect(isPowerOfTwoBitwise(1024)).toBeTruthy();
21-
expect(isPowerOfTwoBitwise(1023)).toBeFalsy();
5+
expect(isPowerOfTwoBitwise(-1)).toBe(false);
6+
expect(isPowerOfTwoBitwise(0)).toBe(false);
7+
expect(isPowerOfTwoBitwise(1)).toBe(true);
8+
expect(isPowerOfTwoBitwise(2)).toBe(true);
9+
expect(isPowerOfTwoBitwise(3)).toBe(false);
10+
expect(isPowerOfTwoBitwise(4)).toBe(true);
11+
expect(isPowerOfTwoBitwise(5)).toBe(false);
12+
expect(isPowerOfTwoBitwise(6)).toBe(false);
13+
expect(isPowerOfTwoBitwise(7)).toBe(false);
14+
expect(isPowerOfTwoBitwise(8)).toBe(true);
15+
expect(isPowerOfTwoBitwise(10)).toBe(false);
16+
expect(isPowerOfTwoBitwise(12)).toBe(false);
17+
expect(isPowerOfTwoBitwise(16)).toBe(true);
18+
expect(isPowerOfTwoBitwise(31)).toBe(false);
19+
expect(isPowerOfTwoBitwise(64)).toBe(true);
20+
expect(isPowerOfTwoBitwise(1024)).toBe(true);
21+
expect(isPowerOfTwoBitwise(1023)).toBe(false);
2222
});
2323
});

‎src/algorithms/math/primality-test/__test__/trialDivision.test.js

+21-21
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,30 @@ import trialDivision from '../trialDivision';
44
* @param {function(n: number)} testFunction
55
*/
66
function primalityTest(testFunction) {
7-
expect(testFunction(1)).toBeFalsy();
8-
expect(testFunction(2)).toBeTruthy();
9-
expect(testFunction(3)).toBeTruthy();
10-
expect(testFunction(5)).toBeTruthy();
11-
expect(testFunction(11)).toBeTruthy();
12-
expect(testFunction(191)).toBeTruthy();
13-
expect(testFunction(191)).toBeTruthy();
14-
expect(testFunction(199)).toBeTruthy();
7+
expect(testFunction(1)).toBe(false);
8+
expect(testFunction(2)).toBe(true);
9+
expect(testFunction(3)).toBe(true);
10+
expect(testFunction(5)).toBe(true);
11+
expect(testFunction(11)).toBe(true);
12+
expect(testFunction(191)).toBe(true);
13+
expect(testFunction(191)).toBe(true);
14+
expect(testFunction(199)).toBe(true);
1515

16-
expect(testFunction(-1)).toBeFalsy();
17-
expect(testFunction(0)).toBeFalsy();
18-
expect(testFunction(4)).toBeFalsy();
19-
expect(testFunction(6)).toBeFalsy();
20-
expect(testFunction(12)).toBeFalsy();
21-
expect(testFunction(14)).toBeFalsy();
22-
expect(testFunction(25)).toBeFalsy();
23-
expect(testFunction(192)).toBeFalsy();
24-
expect(testFunction(200)).toBeFalsy();
25-
expect(testFunction(400)).toBeFalsy();
16+
expect(testFunction(-1)).toBe(false);
17+
expect(testFunction(0)).toBe(false);
18+
expect(testFunction(4)).toBe(false);
19+
expect(testFunction(6)).toBe(false);
20+
expect(testFunction(12)).toBe(false);
21+
expect(testFunction(14)).toBe(false);
22+
expect(testFunction(25)).toBe(false);
23+
expect(testFunction(192)).toBe(false);
24+
expect(testFunction(200)).toBe(false);
25+
expect(testFunction(400)).toBe(false);
2626

2727
// It should also deal with floats.
28-
expect(testFunction(0.5)).toBeFalsy();
29-
expect(testFunction(1.3)).toBeFalsy();
30-
expect(testFunction(10.5)).toBeFalsy();
28+
expect(testFunction(0.5)).toBe(false);
29+
expect(testFunction(1.3)).toBe(false);
30+
expect(testFunction(10.5)).toBe(false);
3131
}
3232

3333
describe('trialDivision', () => {

‎src/algorithms/string/regular-expression-matching/__test__/regularExpressionMatching.test.js

+27-27
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,33 @@ import regularExpressionMatching from '../regularExpressionMatching';
22

33
describe('regularExpressionMatching', () => {
44
it('should match regular expressions in a string', () => {
5-
expect(regularExpressionMatching('', '')).toBeTruthy();
6-
expect(regularExpressionMatching('a', 'a')).toBeTruthy();
7-
expect(regularExpressionMatching('aa', 'aa')).toBeTruthy();
8-
expect(regularExpressionMatching('aab', 'aab')).toBeTruthy();
9-
expect(regularExpressionMatching('aab', 'aa.')).toBeTruthy();
10-
expect(regularExpressionMatching('aab', '.a.')).toBeTruthy();
11-
expect(regularExpressionMatching('aab', '...')).toBeTruthy();
12-
expect(regularExpressionMatching('a', 'a*')).toBeTruthy();
13-
expect(regularExpressionMatching('aaa', 'a*')).toBeTruthy();
14-
expect(regularExpressionMatching('aaab', 'a*b')).toBeTruthy();
15-
expect(regularExpressionMatching('aaabb', 'a*b*')).toBeTruthy();
16-
expect(regularExpressionMatching('aaabb', 'a*b*c*')).toBeTruthy();
17-
expect(regularExpressionMatching('', 'a*')).toBeTruthy();
18-
expect(regularExpressionMatching('xaabyc', 'xa*b.c')).toBeTruthy();
19-
expect(regularExpressionMatching('aab', 'c*a*b*')).toBeTruthy();
20-
expect(regularExpressionMatching('mississippi', 'mis*is*.p*.')).toBeTruthy();
21-
expect(regularExpressionMatching('ab', '.*')).toBeTruthy();
5+
expect(regularExpressionMatching('', '')).toBe(true);
6+
expect(regularExpressionMatching('a', 'a')).toBe(true);
7+
expect(regularExpressionMatching('aa', 'aa')).toBe(true);
8+
expect(regularExpressionMatching('aab', 'aab')).toBe(true);
9+
expect(regularExpressionMatching('aab', 'aa.')).toBe(true);
10+
expect(regularExpressionMatching('aab', '.a.')).toBe(true);
11+
expect(regularExpressionMatching('aab', '...')).toBe(true);
12+
expect(regularExpressionMatching('a', 'a*')).toBe(true);
13+
expect(regularExpressionMatching('aaa', 'a*')).toBe(true);
14+
expect(regularExpressionMatching('aaab', 'a*b')).toBe(true);
15+
expect(regularExpressionMatching('aaabb', 'a*b*')).toBe(true);
16+
expect(regularExpressionMatching('aaabb', 'a*b*c*')).toBe(true);
17+
expect(regularExpressionMatching('', 'a*')).toBe(true);
18+
expect(regularExpressionMatching('xaabyc', 'xa*b.c')).toBe(true);
19+
expect(regularExpressionMatching('aab', 'c*a*b*')).toBe(true);
20+
expect(regularExpressionMatching('mississippi', 'mis*is*.p*.')).toBe(true);
21+
expect(regularExpressionMatching('ab', '.*')).toBe(true);
2222

23-
expect(regularExpressionMatching('', 'a')).toBeFalsy();
24-
expect(regularExpressionMatching('a', '')).toBeFalsy();
25-
expect(regularExpressionMatching('aab', 'aa')).toBeFalsy();
26-
expect(regularExpressionMatching('aab', 'baa')).toBeFalsy();
27-
expect(regularExpressionMatching('aabc', '...')).toBeFalsy();
28-
expect(regularExpressionMatching('aaabbdd', 'a*b*c*')).toBeFalsy();
29-
expect(regularExpressionMatching('mississippi', 'mis*is*p*.')).toBeFalsy();
30-
expect(regularExpressionMatching('ab', 'a*')).toBeFalsy();
31-
expect(regularExpressionMatching('abba', 'a*b*.c')).toBeFalsy();
32-
expect(regularExpressionMatching('abba', '.*c')).toBeFalsy();
23+
expect(regularExpressionMatching('', 'a')).toBe(false);
24+
expect(regularExpressionMatching('a', '')).toBe(false);
25+
expect(regularExpressionMatching('aab', 'aa')).toBe(false);
26+
expect(regularExpressionMatching('aab', 'baa')).toBe(false);
27+
expect(regularExpressionMatching('aabc', '...')).toBe(false);
28+
expect(regularExpressionMatching('aaabbdd', 'a*b*c*')).toBe(false);
29+
expect(regularExpressionMatching('mississippi', 'mis*is*p*.')).toBe(false);
30+
expect(regularExpressionMatching('ab', 'a*')).toBe(false);
31+
expect(regularExpressionMatching('abba', 'a*b*.c')).toBe(false);
32+
expect(regularExpressionMatching('abba', '.*c')).toBe(false);
3333
});
3434
});

‎src/algorithms/uncategorized/jump-game/__test__/backtrackingJumpGame.test.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import backtrackingJumpGame from '../backtrackingJumpGame';
22

33
describe('backtrackingJumpGame', () => {
44
it('should solve Jump Game problem in backtracking manner', () => {
5-
expect(backtrackingJumpGame([1, 0])).toBeTruthy();
6-
expect(backtrackingJumpGame([100, 0])).toBeTruthy();
7-
expect(backtrackingJumpGame([2, 3, 1, 1, 4])).toBeTruthy();
8-
expect(backtrackingJumpGame([1, 1, 1, 1, 1])).toBeTruthy();
9-
expect(backtrackingJumpGame([1, 1, 1, 10, 1])).toBeTruthy();
10-
expect(backtrackingJumpGame([1, 5, 2, 1, 0, 2, 0])).toBeTruthy();
5+
expect(backtrackingJumpGame([1, 0])).toBe(true);
6+
expect(backtrackingJumpGame([100, 0])).toBe(true);
7+
expect(backtrackingJumpGame([2, 3, 1, 1, 4])).toBe(true);
8+
expect(backtrackingJumpGame([1, 1, 1, 1, 1])).toBe(true);
9+
expect(backtrackingJumpGame([1, 1, 1, 10, 1])).toBe(true);
10+
expect(backtrackingJumpGame([1, 5, 2, 1, 0, 2, 0])).toBe(true);
1111

12-
expect(backtrackingJumpGame([1, 0, 1])).toBeFalsy();
13-
expect(backtrackingJumpGame([3, 2, 1, 0, 4])).toBeFalsy();
14-
expect(backtrackingJumpGame([0, 0, 0, 0, 0])).toBeFalsy();
15-
expect(backtrackingJumpGame([5, 4, 3, 2, 1, 0, 0])).toBeFalsy();
12+
expect(backtrackingJumpGame([1, 0, 1])).toBe(false);
13+
expect(backtrackingJumpGame([3, 2, 1, 0, 4])).toBe(false);
14+
expect(backtrackingJumpGame([0, 0, 0, 0, 0])).toBe(false);
15+
expect(backtrackingJumpGame([5, 4, 3, 2, 1, 0, 0])).toBe(false);
1616
});
1717
});

‎src/algorithms/uncategorized/jump-game/__test__/dpBottomUpJumpGame.test.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import dpBottomUpJumpGame from '../dpBottomUpJumpGame';
22

33
describe('dpBottomUpJumpGame', () => {
44
it('should solve Jump Game problem in bottom-up dynamic programming manner', () => {
5-
expect(dpBottomUpJumpGame([1, 0])).toBeTruthy();
6-
expect(dpBottomUpJumpGame([100, 0])).toBeTruthy();
7-
expect(dpBottomUpJumpGame([2, 3, 1, 1, 4])).toBeTruthy();
8-
expect(dpBottomUpJumpGame([1, 1, 1, 1, 1])).toBeTruthy();
9-
expect(dpBottomUpJumpGame([1, 1, 1, 10, 1])).toBeTruthy();
10-
expect(dpBottomUpJumpGame([1, 5, 2, 1, 0, 2, 0])).toBeTruthy();
5+
expect(dpBottomUpJumpGame([1, 0])).toBe(true);
6+
expect(dpBottomUpJumpGame([100, 0])).toBe(true);
7+
expect(dpBottomUpJumpGame([2, 3, 1, 1, 4])).toBe(true);
8+
expect(dpBottomUpJumpGame([1, 1, 1, 1, 1])).toBe(true);
9+
expect(dpBottomUpJumpGame([1, 1, 1, 10, 1])).toBe(true);
10+
expect(dpBottomUpJumpGame([1, 5, 2, 1, 0, 2, 0])).toBe(true);
1111

12-
expect(dpBottomUpJumpGame([1, 0, 1])).toBeFalsy();
13-
expect(dpBottomUpJumpGame([3, 2, 1, 0, 4])).toBeFalsy();
14-
expect(dpBottomUpJumpGame([0, 0, 0, 0, 0])).toBeFalsy();
15-
expect(dpBottomUpJumpGame([5, 4, 3, 2, 1, 0, 0])).toBeFalsy();
12+
expect(dpBottomUpJumpGame([1, 0, 1])).toBe(false);
13+
expect(dpBottomUpJumpGame([3, 2, 1, 0, 4])).toBe(false);
14+
expect(dpBottomUpJumpGame([0, 0, 0, 0, 0])).toBe(false);
15+
expect(dpBottomUpJumpGame([5, 4, 3, 2, 1, 0, 0])).toBe(false);
1616
});
1717
});

‎src/algorithms/uncategorized/jump-game/__test__/dpTopDownJumpGame.test.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import dpTopDownJumpGame from '../dpTopDownJumpGame';
22

33
describe('dpTopDownJumpGame', () => {
44
it('should solve Jump Game problem in top-down dynamic programming manner', () => {
5-
expect(dpTopDownJumpGame([1, 0])).toBeTruthy();
6-
expect(dpTopDownJumpGame([100, 0])).toBeTruthy();
7-
expect(dpTopDownJumpGame([2, 3, 1, 1, 4])).toBeTruthy();
8-
expect(dpTopDownJumpGame([1, 1, 1, 1, 1])).toBeTruthy();
9-
expect(dpTopDownJumpGame([1, 1, 1, 10, 1])).toBeTruthy();
10-
expect(dpTopDownJumpGame([1, 5, 2, 1, 0, 2, 0])).toBeTruthy();
5+
expect(dpTopDownJumpGame([1, 0])).toBe(true);
6+
expect(dpTopDownJumpGame([100, 0])).toBe(true);
7+
expect(dpTopDownJumpGame([2, 3, 1, 1, 4])).toBe(true);
8+
expect(dpTopDownJumpGame([1, 1, 1, 1, 1])).toBe(true);
9+
expect(dpTopDownJumpGame([1, 1, 1, 10, 1])).toBe(true);
10+
expect(dpTopDownJumpGame([1, 5, 2, 1, 0, 2, 0])).toBe(true);
1111

12-
expect(dpTopDownJumpGame([1, 0, 1])).toBeFalsy();
13-
expect(dpTopDownJumpGame([3, 2, 1, 0, 4])).toBeFalsy();
14-
expect(dpTopDownJumpGame([0, 0, 0, 0, 0])).toBeFalsy();
15-
expect(dpTopDownJumpGame([5, 4, 3, 2, 1, 0, 0])).toBeFalsy();
12+
expect(dpTopDownJumpGame([1, 0, 1])).toBe(false);
13+
expect(dpTopDownJumpGame([3, 2, 1, 0, 4])).toBe(false);
14+
expect(dpTopDownJumpGame([0, 0, 0, 0, 0])).toBe(false);
15+
expect(dpTopDownJumpGame([5, 4, 3, 2, 1, 0, 0])).toBe(false);
1616
});
1717
});

‎src/algorithms/uncategorized/jump-game/__test__/greedyJumpGame.test.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import greedyJumpGame from '../greedyJumpGame';
22

33
describe('greedyJumpGame', () => {
44
it('should solve Jump Game problem in greedy manner', () => {
5-
expect(greedyJumpGame([1, 0])).toBeTruthy();
6-
expect(greedyJumpGame([100, 0])).toBeTruthy();
7-
expect(greedyJumpGame([2, 3, 1, 1, 4])).toBeTruthy();
8-
expect(greedyJumpGame([1, 1, 1, 1, 1])).toBeTruthy();
9-
expect(greedyJumpGame([1, 1, 1, 10, 1])).toBeTruthy();
10-
expect(greedyJumpGame([1, 5, 2, 1, 0, 2, 0])).toBeTruthy();
5+
expect(greedyJumpGame([1, 0])).toBe(true);
6+
expect(greedyJumpGame([100, 0])).toBe(true);
7+
expect(greedyJumpGame([2, 3, 1, 1, 4])).toBe(true);
8+
expect(greedyJumpGame([1, 1, 1, 1, 1])).toBe(true);
9+
expect(greedyJumpGame([1, 1, 1, 10, 1])).toBe(true);
10+
expect(greedyJumpGame([1, 5, 2, 1, 0, 2, 0])).toBe(true);
1111

12-
expect(greedyJumpGame([1, 0, 1])).toBeFalsy();
13-
expect(greedyJumpGame([3, 2, 1, 0, 4])).toBeFalsy();
14-
expect(greedyJumpGame([0, 0, 0, 0, 0])).toBeFalsy();
15-
expect(greedyJumpGame([5, 4, 3, 2, 1, 0, 0])).toBeFalsy();
12+
expect(greedyJumpGame([1, 0, 1])).toBe(false);
13+
expect(greedyJumpGame([3, 2, 1, 0, 4])).toBe(false);
14+
expect(greedyJumpGame([0, 0, 0, 0, 0])).toBe(false);
15+
expect(greedyJumpGame([5, 4, 3, 2, 1, 0, 0])).toBe(false);
1616
});
1717
});

‎src/data-structures/bloom-filter/__test__/BloomFilter.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ describe('BloomFilter', () => {
5353
it('should insert strings correctly and return true when checking for inserted values', () => {
5454
people.forEach(person => bloomFilter.insert(person));
5555

56-
expect(bloomFilter.mayContain('Bruce Wayne')).toBeTruthy();
57-
expect(bloomFilter.mayContain('Clark Kent')).toBeTruthy();
58-
expect(bloomFilter.mayContain('Barry Allen')).toBeTruthy();
56+
expect(bloomFilter.mayContain('Bruce Wayne')).toBe(true);
57+
expect(bloomFilter.mayContain('Clark Kent')).toBe(true);
58+
expect(bloomFilter.mayContain('Barry Allen')).toBe(true);
5959

60-
expect(bloomFilter.mayContain('Tony Stark')).toBeFalsy();
60+
expect(bloomFilter.mayContain('Tony Stark')).toBe(false);
6161
});
6262
});

‎src/data-structures/disjoint-set/__test__/DisjointSet.test.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ describe('DisjointSet', () => {
3636

3737
disjointSet.makeSet('C');
3838

39-
expect(disjointSet.inSameSet('A', 'B')).toBeFalsy();
39+
expect(disjointSet.inSameSet('A', 'B')).toBe(false);
4040

4141
disjointSet.union('A', 'B');
4242

4343
expect(disjointSet.find('A')).toBe('A');
4444
expect(disjointSet.find('B')).toBe('A');
45-
expect(disjointSet.inSameSet('A', 'B')).toBeTruthy();
46-
expect(disjointSet.inSameSet('B', 'A')).toBeTruthy();
47-
expect(disjointSet.inSameSet('A', 'C')).toBeFalsy();
45+
expect(disjointSet.inSameSet('A', 'B')).toBe(true);
46+
expect(disjointSet.inSameSet('B', 'A')).toBe(true);
47+
expect(disjointSet.inSameSet('A', 'C')).toBe(false);
4848

4949
disjointSet.union('A', 'A');
5050

@@ -54,9 +54,9 @@ describe('DisjointSet', () => {
5454
expect(disjointSet.find('B')).toBe('A');
5555
expect(disjointSet.find('C')).toBe('A');
5656

57-
expect(disjointSet.inSameSet('A', 'B')).toBeTruthy();
58-
expect(disjointSet.inSameSet('B', 'C')).toBeTruthy();
59-
expect(disjointSet.inSameSet('A', 'C')).toBeTruthy();
57+
expect(disjointSet.inSameSet('A', 'B')).toBe(true);
58+
expect(disjointSet.inSameSet('B', 'C')).toBe(true);
59+
expect(disjointSet.inSameSet('A', 'C')).toBe(true);
6060

6161
disjointSet
6262
.makeSet('E')
@@ -71,13 +71,13 @@ describe('DisjointSet', () => {
7171
.union('G', 'H')
7272
.union('H', 'I');
7373

74-
expect(disjointSet.inSameSet('A', 'I')).toBeFalsy();
75-
expect(disjointSet.inSameSet('E', 'I')).toBeTruthy();
74+
expect(disjointSet.inSameSet('A', 'I')).toBe(false);
75+
expect(disjointSet.inSameSet('E', 'I')).toBe(true);
7676

7777
disjointSet.union('I', 'C');
7878

7979
expect(disjointSet.find('I')).toBe('E');
80-
expect(disjointSet.inSameSet('A', 'I')).toBeTruthy();
80+
expect(disjointSet.inSameSet('A', 'I')).toBe(true);
8181
});
8282

8383
it('should union smaller set with bigger one making bigger one to be new root', () => {
@@ -117,24 +117,24 @@ describe('DisjointSet', () => {
117117

118118
disjointSet.makeSet(itemC);
119119

120-
expect(disjointSet.inSameSet(itemA, itemB)).toBeFalsy();
120+
expect(disjointSet.inSameSet(itemA, itemB)).toBe(false);
121121

122122
disjointSet.union(itemA, itemB);
123123

124124
expect(disjointSet.find(itemA)).toBe('A');
125125
expect(disjointSet.find(itemB)).toBe('A');
126-
expect(disjointSet.inSameSet(itemA, itemB)).toBeTruthy();
127-
expect(disjointSet.inSameSet(itemB, itemA)).toBeTruthy();
128-
expect(disjointSet.inSameSet(itemA, itemC)).toBeFalsy();
126+
expect(disjointSet.inSameSet(itemA, itemB)).toBe(true);
127+
expect(disjointSet.inSameSet(itemB, itemA)).toBe(true);
128+
expect(disjointSet.inSameSet(itemA, itemC)).toBe(false);
129129

130130
disjointSet.union(itemA, itemC);
131131

132132
expect(disjointSet.find(itemA)).toBe('A');
133133
expect(disjointSet.find(itemB)).toBe('A');
134134
expect(disjointSet.find(itemC)).toBe('A');
135135

136-
expect(disjointSet.inSameSet(itemA, itemB)).toBeTruthy();
137-
expect(disjointSet.inSameSet(itemB, itemC)).toBeTruthy();
138-
expect(disjointSet.inSameSet(itemA, itemC)).toBeTruthy();
136+
expect(disjointSet.inSameSet(itemA, itemB)).toBe(true);
137+
expect(disjointSet.inSameSet(itemB, itemC)).toBe(true);
138+
expect(disjointSet.inSameSet(itemA, itemC)).toBe(true);
139139
});
140140
});

‎src/data-structures/disjoint-set/__test__/DisjointSetItem.test.js

+20-20
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ describe('DisjointSetItem', () => {
1111
expect(itemA.getChildren()).toEqual([]);
1212
expect(itemA.getKey()).toBe('A');
1313
expect(itemA.getRoot()).toEqual(itemA);
14-
expect(itemA.isRoot()).toBeTruthy();
15-
expect(itemB.isRoot()).toBeTruthy();
14+
expect(itemA.isRoot()).toBe(true);
15+
expect(itemB.isRoot()).toBe(true);
1616

1717
itemA.addChild(itemB);
1818
itemD.setParent(itemC);
@@ -38,17 +38,17 @@ describe('DisjointSetItem', () => {
3838
expect(itemC.getRoot()).toEqual(itemC);
3939
expect(itemD.getRoot()).toEqual(itemC);
4040

41-
expect(itemA.isRoot()).toBeTruthy();
42-
expect(itemB.isRoot()).toBeFalsy();
43-
expect(itemC.isRoot()).toBeTruthy();
44-
expect(itemD.isRoot()).toBeFalsy();
41+
expect(itemA.isRoot()).toBe(true);
42+
expect(itemB.isRoot()).toBe(false);
43+
expect(itemC.isRoot()).toBe(true);
44+
expect(itemD.isRoot()).toBe(false);
4545

4646
itemA.addChild(itemC);
4747

48-
expect(itemA.isRoot()).toBeTruthy();
49-
expect(itemB.isRoot()).toBeFalsy();
50-
expect(itemC.isRoot()).toBeFalsy();
51-
expect(itemD.isRoot()).toBeFalsy();
48+
expect(itemA.isRoot()).toBe(true);
49+
expect(itemB.isRoot()).toBe(false);
50+
expect(itemC.isRoot()).toBe(false);
51+
expect(itemD.isRoot()).toBe(false);
5252

5353
expect(itemA.getRank()).toEqual(3);
5454
expect(itemB.getRank()).toEqual(0);
@@ -69,8 +69,8 @@ describe('DisjointSetItem', () => {
6969
expect(itemA.getChildren()).toEqual([]);
7070
expect(itemA.getKey()).toBe('A');
7171
expect(itemA.getRoot()).toEqual(itemA);
72-
expect(itemA.isRoot()).toBeTruthy();
73-
expect(itemB.isRoot()).toBeTruthy();
72+
expect(itemA.isRoot()).toBe(true);
73+
expect(itemB.isRoot()).toBe(true);
7474

7575
itemA.addChild(itemB);
7676
itemD.setParent(itemC);
@@ -96,17 +96,17 @@ describe('DisjointSetItem', () => {
9696
expect(itemC.getRoot()).toEqual(itemC);
9797
expect(itemD.getRoot()).toEqual(itemC);
9898

99-
expect(itemA.isRoot()).toBeTruthy();
100-
expect(itemB.isRoot()).toBeFalsy();
101-
expect(itemC.isRoot()).toBeTruthy();
102-
expect(itemD.isRoot()).toBeFalsy();
99+
expect(itemA.isRoot()).toBe(true);
100+
expect(itemB.isRoot()).toBe(false);
101+
expect(itemC.isRoot()).toBe(true);
102+
expect(itemD.isRoot()).toBe(false);
103103

104104
itemA.addChild(itemC);
105105

106-
expect(itemA.isRoot()).toBeTruthy();
107-
expect(itemB.isRoot()).toBeFalsy();
108-
expect(itemC.isRoot()).toBeFalsy();
109-
expect(itemD.isRoot()).toBeFalsy();
106+
expect(itemA.isRoot()).toBe(true);
107+
expect(itemB.isRoot()).toBe(false);
108+
expect(itemC.isRoot()).toBe(false);
109+
expect(itemD.isRoot()).toBe(false);
110110

111111
expect(itemA.getRank()).toEqual(3);
112112
expect(itemB.getRank()).toEqual(0);

‎src/data-structures/graph/__test__/GraphVertex.test.js

+20-20
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ describe('GraphVertex', () => {
3131
const edgeAB = new GraphEdge(vertexA, vertexB);
3232
vertexA.addEdge(edgeAB);
3333

34-
expect(vertexA.hasEdge(edgeAB)).toBeTruthy();
35-
expect(vertexB.hasEdge(edgeAB)).toBeFalsy();
34+
expect(vertexA.hasEdge(edgeAB)).toBe(true);
35+
expect(vertexB.hasEdge(edgeAB)).toBe(false);
3636
expect(vertexA.getEdges().length).toBe(1);
3737
expect(vertexA.getEdges()[0].toString()).toBe('A_B');
3838
});
@@ -48,25 +48,25 @@ describe('GraphVertex', () => {
4848
.addEdge(edgeAB)
4949
.addEdge(edgeAC);
5050

51-
expect(vertexA.hasEdge(edgeAB)).toBeTruthy();
52-
expect(vertexB.hasEdge(edgeAB)).toBeFalsy();
51+
expect(vertexA.hasEdge(edgeAB)).toBe(true);
52+
expect(vertexB.hasEdge(edgeAB)).toBe(false);
5353

54-
expect(vertexA.hasEdge(edgeAC)).toBeTruthy();
55-
expect(vertexC.hasEdge(edgeAC)).toBeFalsy();
54+
expect(vertexA.hasEdge(edgeAC)).toBe(true);
55+
expect(vertexC.hasEdge(edgeAC)).toBe(false);
5656

5757
expect(vertexA.getEdges().length).toBe(2);
5858

5959
expect(vertexA.getEdges()[0].toString()).toBe('A_B');
6060
expect(vertexA.getEdges()[1].toString()).toBe('A_C');
6161

6262
vertexA.deleteEdge(edgeAB);
63-
expect(vertexA.hasEdge(edgeAB)).toBeFalsy();
64-
expect(vertexA.hasEdge(edgeAC)).toBeTruthy();
63+
expect(vertexA.hasEdge(edgeAB)).toBe(false);
64+
expect(vertexA.hasEdge(edgeAC)).toBe(true);
6565
expect(vertexA.getEdges()[0].toString()).toBe('A_C');
6666

6767
vertexA.deleteEdge(edgeAC);
68-
expect(vertexA.hasEdge(edgeAB)).toBeFalsy();
69-
expect(vertexA.hasEdge(edgeAC)).toBeFalsy();
68+
expect(vertexA.hasEdge(edgeAB)).toBe(false);
69+
expect(vertexA.hasEdge(edgeAC)).toBe(false);
7070
expect(vertexA.getEdges().length).toBe(0);
7171
});
7272

@@ -81,21 +81,21 @@ describe('GraphVertex', () => {
8181
.addEdge(edgeAB)
8282
.addEdge(edgeAC);
8383

84-
expect(vertexA.hasEdge(edgeAB)).toBeTruthy();
85-
expect(vertexB.hasEdge(edgeAB)).toBeFalsy();
84+
expect(vertexA.hasEdge(edgeAB)).toBe(true);
85+
expect(vertexB.hasEdge(edgeAB)).toBe(false);
8686

87-
expect(vertexA.hasEdge(edgeAC)).toBeTruthy();
88-
expect(vertexC.hasEdge(edgeAC)).toBeFalsy();
87+
expect(vertexA.hasEdge(edgeAC)).toBe(true);
88+
expect(vertexC.hasEdge(edgeAC)).toBe(false);
8989

9090
expect(vertexA.getEdges().length).toBe(2);
9191

9292
vertexA.deleteAllEdges();
9393

94-
expect(vertexA.hasEdge(edgeAB)).toBeFalsy();
95-
expect(vertexB.hasEdge(edgeAB)).toBeFalsy();
94+
expect(vertexA.hasEdge(edgeAB)).toBe(false);
95+
expect(vertexB.hasEdge(edgeAB)).toBe(false);
9696

97-
expect(vertexA.hasEdge(edgeAC)).toBeFalsy();
98-
expect(vertexC.hasEdge(edgeAC)).toBeFalsy();
97+
expect(vertexA.hasEdge(edgeAC)).toBe(false);
98+
expect(vertexC.hasEdge(edgeAC)).toBe(false);
9999

100100
expect(vertexA.getEdges().length).toBe(0);
101101
});
@@ -148,8 +148,8 @@ describe('GraphVertex', () => {
148148
const edgeAB = new GraphEdge(vertexA, vertexB);
149149
vertexA.addEdge(edgeAB);
150150

151-
expect(vertexA.hasNeighbor(vertexB)).toBeTruthy();
152-
expect(vertexA.hasNeighbor(vertexC)).toBeFalsy();
151+
expect(vertexA.hasNeighbor(vertexB)).toBe(true);
152+
expect(vertexA.hasNeighbor(vertexC)).toBe(false);
153153
});
154154

155155
it('should edge by vertex', () => {

‎src/data-structures/hash-table/__test__/HashTable.test.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ describe('HashTable', () => {
3131
hashTable.set('c', 'earth');
3232
hashTable.set('d', 'ocean');
3333

34-
expect(hashTable.has('x')).toBeFalsy();
35-
expect(hashTable.has('b')).toBeTruthy();
36-
expect(hashTable.has('c')).toBeTruthy();
34+
expect(hashTable.has('x')).toBe(false);
35+
expect(hashTable.has('b')).toBe(true);
36+
expect(hashTable.has('c')).toBe(true);
3737

3838
const stringifier = value => `${value.key}:${value.value}`;
3939

@@ -77,13 +77,13 @@ describe('HashTable', () => {
7777
hashTable.set('d', 'ocean');
7878

7979
expect(hashTable.getKeys()).toEqual(['a', 'b', 'c', 'd']);
80-
expect(hashTable.has('a')).toBeTruthy();
81-
expect(hashTable.has('x')).toBeFalsy();
80+
expect(hashTable.has('a')).toBe(true);
81+
expect(hashTable.has('x')).toBe(false);
8282

8383
hashTable.delete('a');
8484

85-
expect(hashTable.has('a')).toBeFalsy();
86-
expect(hashTable.has('b')).toBeTruthy();
87-
expect(hashTable.has('x')).toBeFalsy();
85+
expect(hashTable.has('a')).toBe(false);
86+
expect(hashTable.has('b')).toBe(true);
87+
expect(hashTable.has('x')).toBe(false);
8888
});
8989
});

‎src/data-structures/heap/__test__/MinHeap.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ describe('MinHeap', () => {
77

88
expect(minHeap).toBeDefined();
99
expect(minHeap.peek()).toBeNull();
10-
expect(minHeap.isEmpty()).toBeTruthy();
10+
expect(minHeap.isEmpty()).toBe(true);
1111
});
1212

1313
it('should add items to the heap and heapify it up', () => {
1414
const minHeap = new MinHeap();
1515

1616
minHeap.add(5);
17-
expect(minHeap.isEmpty()).toBeFalsy();
17+
expect(minHeap.isEmpty()).toBe(false);
1818
expect(minHeap.peek()).toBe(5);
1919
expect(minHeap.toString()).toBe('5');
2020

‎src/data-structures/priority-queue/__test__/PriorityQueue.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ describe('PriorityQueue', () => {
9797
priorityQueue.add(200, 0);
9898
priorityQueue.add(15, 15);
9999

100-
expect(priorityQueue.hasValue(70)).toBeFalsy();
101-
expect(priorityQueue.hasValue(15)).toBeTruthy();
100+
expect(priorityQueue.hasValue(70)).toBe(false);
101+
expect(priorityQueue.hasValue(15)).toBe(true);
102102
});
103103
});

‎src/data-structures/queue/__test__/Queue.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ describe('Queue', () => {
4444
it('should check if queue is empty', () => {
4545
const queue = new Queue();
4646

47-
expect(queue.isEmpty()).toBeTruthy();
47+
expect(queue.isEmpty()).toBe(true);
4848

4949
queue.enqueue(1);
5050

51-
expect(queue.isEmpty()).toBeFalsy();
51+
expect(queue.isEmpty()).toBe(false);
5252
});
5353

5454
it('should dequeue from queue in FIFO order', () => {
@@ -60,6 +60,6 @@ describe('Queue', () => {
6060
expect(queue.dequeue()).toBe(1);
6161
expect(queue.dequeue()).toBe(2);
6262
expect(queue.dequeue()).toBeNull();
63-
expect(queue.isEmpty()).toBeTruthy();
63+
expect(queue.isEmpty()).toBe(true);
6464
});
6565
});

‎src/data-structures/stack/__test__/Stack.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ describe('Stack', () => {
3131
it('should check if stack is empty', () => {
3232
const stack = new Stack();
3333

34-
expect(stack.isEmpty()).toBeTruthy();
34+
expect(stack.isEmpty()).toBe(true);
3535

3636
stack.push(1);
3737

38-
expect(stack.isEmpty()).toBeFalsy();
38+
expect(stack.isEmpty()).toBe(false);
3939
});
4040

4141
it('should pop data from stack', () => {
@@ -47,7 +47,7 @@ describe('Stack', () => {
4747
expect(stack.pop()).toBe(2);
4848
expect(stack.pop()).toBe(1);
4949
expect(stack.pop()).toBeNull();
50-
expect(stack.isEmpty()).toBeTruthy();
50+
expect(stack.isEmpty()).toBe(true);
5151
});
5252

5353
it('should be possible to push/pop objects', () => {

‎src/data-structures/tree/__test__/BinaryTreeNode.test.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ describe('BinaryTreeNode', () => {
6363

6464
expect(rootNode.traverseInOrder()).toEqual([1, 2, 3]);
6565

66-
expect(rootNode.removeChild(rootNode.left)).toBeTruthy();
66+
expect(rootNode.removeChild(rootNode.left)).toBe(true);
6767
expect(rootNode.traverseInOrder()).toEqual([2, 3]);
6868

69-
expect(rootNode.removeChild(rootNode.right)).toBeTruthy();
69+
expect(rootNode.removeChild(rootNode.right)).toBe(true);
7070
expect(rootNode.traverseInOrder()).toEqual([2]);
7171

72-
expect(rootNode.removeChild(rootNode.right)).toBeFalsy();
72+
expect(rootNode.removeChild(rootNode.right)).toBe(false);
7373
expect(rootNode.traverseInOrder()).toEqual([2]);
7474
});
7575

@@ -89,21 +89,21 @@ describe('BinaryTreeNode', () => {
8989

9090
expect(rootNode.traverseInOrder()).toEqual([1, 2, 3, 5]);
9191

92-
expect(rootNode.replaceChild(rootNode.right, rootNode.right.right)).toBeTruthy();
92+
expect(rootNode.replaceChild(rootNode.right, rootNode.right.right)).toBe(true);
9393
expect(rootNode.right.value).toBe(5);
9494
expect(rootNode.right.right).toBeNull();
9595
expect(rootNode.traverseInOrder()).toEqual([1, 2, 5]);
9696

97-
expect(rootNode.replaceChild(rootNode.right, rootNode.right.right)).toBeFalsy();
97+
expect(rootNode.replaceChild(rootNode.right, rootNode.right.right)).toBe(false);
9898
expect(rootNode.traverseInOrder()).toEqual([1, 2, 5]);
9999

100-
expect(rootNode.replaceChild(rootNode.right, replacementNode)).toBeTruthy();
100+
expect(rootNode.replaceChild(rootNode.right, replacementNode)).toBe(true);
101101
expect(rootNode.traverseInOrder()).toEqual([1, 2, 5]);
102102

103-
expect(rootNode.replaceChild(rootNode.left, replacementNode)).toBeTruthy();
103+
expect(rootNode.replaceChild(rootNode.left, replacementNode)).toBe(true);
104104
expect(rootNode.traverseInOrder()).toEqual([5, 2, 5]);
105105

106-
expect(rootNode.replaceChild(new BinaryTreeNode(), new BinaryTreeNode())).toBeFalsy();
106+
expect(rootNode.replaceChild(new BinaryTreeNode(), new BinaryTreeNode())).toBe(false);
107107
});
108108

109109
it('should calculate node height', () => {

‎src/data-structures/tree/binary-search-tree/__test__/BinarySearchTree.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ describe('BinarySearchTree', () => {
3030
bst.insert(20);
3131
bst.insert(5);
3232

33-
expect(bst.contains(20)).toBeTruthy();
34-
expect(bst.contains(40)).toBeFalsy();
33+
expect(bst.contains(20)).toBe(true);
34+
expect(bst.contains(40)).toBe(false);
3535
});
3636

3737
it('should remove nodes', () => {
@@ -45,11 +45,11 @@ describe('BinarySearchTree', () => {
4545

4646
const removed1 = bst.remove(5);
4747
expect(bst.toString()).toBe('10,20');
48-
expect(removed1).toBeTruthy();
48+
expect(removed1).toBe(true);
4949

5050
const removed2 = bst.remove(20);
5151
expect(bst.toString()).toBe('10');
52-
expect(removed2).toBeTruthy();
52+
expect(removed2).toBe(true);
5353
});
5454

5555
it('should insert object values', () => {

‎src/data-structures/tree/binary-search-tree/__test__/BinarySearchTreeNode.test.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -24,48 +24,48 @@ describe('BinarySearchTreeNode', () => {
2424

2525
expect(insertedNode1.value).toBe(1);
2626
expect(bstNode.toString()).toBe('1,2');
27-
expect(bstNode.contains(1)).toBeTruthy();
28-
expect(bstNode.contains(3)).toBeFalsy();
27+
expect(bstNode.contains(1)).toBe(true);
28+
expect(bstNode.contains(3)).toBe(false);
2929

3030
const insertedNode2 = bstNode.insert(3);
3131

3232
expect(insertedNode2.value).toBe(3);
3333
expect(bstNode.toString()).toBe('1,2,3');
34-
expect(bstNode.contains(3)).toBeTruthy();
35-
expect(bstNode.contains(4)).toBeFalsy();
34+
expect(bstNode.contains(3)).toBe(true);
35+
expect(bstNode.contains(4)).toBe(false);
3636

3737
bstNode.insert(7);
3838

3939
expect(bstNode.toString()).toBe('1,2,3,7');
40-
expect(bstNode.contains(7)).toBeTruthy();
41-
expect(bstNode.contains(8)).toBeFalsy();
40+
expect(bstNode.contains(7)).toBe(true);
41+
expect(bstNode.contains(8)).toBe(false);
4242

4343
bstNode.insert(4);
4444

4545
expect(bstNode.toString()).toBe('1,2,3,4,7');
46-
expect(bstNode.contains(4)).toBeTruthy();
47-
expect(bstNode.contains(8)).toBeFalsy();
46+
expect(bstNode.contains(4)).toBe(true);
47+
expect(bstNode.contains(8)).toBe(false);
4848

4949
bstNode.insert(6);
5050

5151
expect(bstNode.toString()).toBe('1,2,3,4,6,7');
52-
expect(bstNode.contains(6)).toBeTruthy();
53-
expect(bstNode.contains(8)).toBeFalsy();
52+
expect(bstNode.contains(6)).toBe(true);
53+
expect(bstNode.contains(8)).toBe(false);
5454
});
5555

5656
it('should not insert duplicates', () => {
5757
const bstNode = new BinarySearchTreeNode(2);
5858
bstNode.insert(1);
5959

6060
expect(bstNode.toString()).toBe('1,2');
61-
expect(bstNode.contains(1)).toBeTruthy();
62-
expect(bstNode.contains(3)).toBeFalsy();
61+
expect(bstNode.contains(1)).toBe(true);
62+
expect(bstNode.contains(3)).toBe(false);
6363

6464
bstNode.insert(1);
6565

6666
expect(bstNode.toString()).toBe('1,2');
67-
expect(bstNode.contains(1)).toBeTruthy();
68-
expect(bstNode.contains(3)).toBeFalsy();
67+
expect(bstNode.contains(1)).toBe(true);
68+
expect(bstNode.contains(3)).toBe(false);
6969
});
7070

7171
it('should find min node', () => {
@@ -127,11 +127,11 @@ describe('BinarySearchTreeNode', () => {
127127

128128
const removed1 = bstRootNode.remove(5);
129129
expect(bstRootNode.toString()).toBe('10,20');
130-
expect(removed1).toBeTruthy();
130+
expect(removed1).toBe(true);
131131

132132
const removed2 = bstRootNode.remove(20);
133133
expect(bstRootNode.toString()).toBe('10');
134-
expect(removed2).toBeTruthy();
134+
expect(removed2).toBe(true);
135135
});
136136

137137
it('should remove nodes with one child', () => {
@@ -233,13 +233,13 @@ describe('BinarySearchTreeNode', () => {
233233
bstNode.insert(obj1);
234234

235235
expect(bstNode.toString()).toBe('obj1,obj2');
236-
expect(bstNode.contains(obj1)).toBeTruthy();
237-
expect(bstNode.contains(obj3)).toBeFalsy();
236+
expect(bstNode.contains(obj1)).toBe(true);
237+
expect(bstNode.contains(obj3)).toBe(false);
238238

239239
bstNode.insert(obj3);
240240

241241
expect(bstNode.toString()).toBe('obj1,obj2,obj3');
242-
expect(bstNode.contains(obj3)).toBeTruthy();
242+
expect(bstNode.contains(obj3)).toBe(true);
243243

244244
expect(bstNode.findMin().value).toEqual(obj1);
245245
});

‎src/data-structures/tree/red-black-tree/__test__/RedBlackTree.test.js

+98-98
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ describe('RedBlackTree', () => {
66

77
const firstInsertedNode = tree.insert(10);
88

9-
expect(tree.isNodeColored(firstInsertedNode)).toBeTruthy();
10-
expect(tree.isNodeBlack(firstInsertedNode)).toBeTruthy();
11-
expect(tree.isNodeRed(firstInsertedNode)).toBeFalsy();
9+
expect(tree.isNodeColored(firstInsertedNode)).toBe(true);
10+
expect(tree.isNodeBlack(firstInsertedNode)).toBe(true);
11+
expect(tree.isNodeRed(firstInsertedNode)).toBe(false);
1212

1313
expect(tree.toString()).toBe('10');
1414
expect(tree.root.height).toBe(0);
@@ -21,9 +21,9 @@ describe('RedBlackTree', () => {
2121
const secondInsertedNode = tree.insert(15);
2222
const thirdInsertedNode = tree.insert(5);
2323

24-
expect(tree.isNodeBlack(firstInsertedNode)).toBeTruthy();
25-
expect(tree.isNodeRed(secondInsertedNode)).toBeTruthy();
26-
expect(tree.isNodeRed(thirdInsertedNode)).toBeTruthy();
24+
expect(tree.isNodeBlack(firstInsertedNode)).toBe(true);
25+
expect(tree.isNodeRed(secondInsertedNode)).toBe(true);
26+
expect(tree.isNodeRed(thirdInsertedNode)).toBe(true);
2727

2828
expect(tree.toString()).toBe('5,10,15');
2929
expect(tree.root.height).toBe(1);
@@ -48,42 +48,42 @@ describe('RedBlackTree', () => {
4848

4949
const node1 = tree.insert(10);
5050

51-
expect(tree.isNodeBlack(node1)).toBeTruthy();
51+
expect(tree.isNodeBlack(node1)).toBe(true);
5252

5353
const node2 = tree.insert(-10);
5454

55-
expect(tree.isNodeBlack(node1)).toBeTruthy();
56-
expect(tree.isNodeRed(node2)).toBeTruthy();
55+
expect(tree.isNodeBlack(node1)).toBe(true);
56+
expect(tree.isNodeRed(node2)).toBe(true);
5757

5858
const node3 = tree.insert(20);
5959

60-
expect(tree.isNodeBlack(node1)).toBeTruthy();
61-
expect(tree.isNodeRed(node2)).toBeTruthy();
62-
expect(tree.isNodeRed(node3)).toBeTruthy();
60+
expect(tree.isNodeBlack(node1)).toBe(true);
61+
expect(tree.isNodeRed(node2)).toBe(true);
62+
expect(tree.isNodeRed(node3)).toBe(true);
6363

6464
const node4 = tree.insert(-20);
6565

66-
expect(tree.isNodeBlack(node1)).toBeTruthy();
67-
expect(tree.isNodeBlack(node2)).toBeTruthy();
68-
expect(tree.isNodeBlack(node3)).toBeTruthy();
69-
expect(tree.isNodeRed(node4)).toBeTruthy();
66+
expect(tree.isNodeBlack(node1)).toBe(true);
67+
expect(tree.isNodeBlack(node2)).toBe(true);
68+
expect(tree.isNodeBlack(node3)).toBe(true);
69+
expect(tree.isNodeRed(node4)).toBe(true);
7070

7171
const node5 = tree.insert(25);
7272

73-
expect(tree.isNodeBlack(node1)).toBeTruthy();
74-
expect(tree.isNodeBlack(node2)).toBeTruthy();
75-
expect(tree.isNodeBlack(node3)).toBeTruthy();
76-
expect(tree.isNodeRed(node4)).toBeTruthy();
77-
expect(tree.isNodeRed(node5)).toBeTruthy();
73+
expect(tree.isNodeBlack(node1)).toBe(true);
74+
expect(tree.isNodeBlack(node2)).toBe(true);
75+
expect(tree.isNodeBlack(node3)).toBe(true);
76+
expect(tree.isNodeRed(node4)).toBe(true);
77+
expect(tree.isNodeRed(node5)).toBe(true);
7878

7979
const node6 = tree.insert(6);
8080

81-
expect(tree.isNodeBlack(node1)).toBeTruthy();
82-
expect(tree.isNodeBlack(node2)).toBeTruthy();
83-
expect(tree.isNodeBlack(node3)).toBeTruthy();
84-
expect(tree.isNodeRed(node4)).toBeTruthy();
85-
expect(tree.isNodeRed(node5)).toBeTruthy();
86-
expect(tree.isNodeRed(node6)).toBeTruthy();
81+
expect(tree.isNodeBlack(node1)).toBe(true);
82+
expect(tree.isNodeBlack(node2)).toBe(true);
83+
expect(tree.isNodeBlack(node3)).toBe(true);
84+
expect(tree.isNodeRed(node4)).toBe(true);
85+
expect(tree.isNodeRed(node5)).toBe(true);
86+
expect(tree.isNodeRed(node6)).toBe(true);
8787

8888
expect(tree.toString()).toBe('-20,-10,6,10,20,25');
8989
expect(tree.root.height).toBe(2);
@@ -95,14 +95,14 @@ describe('RedBlackTree', () => {
9595
expect(tree.toString()).toBe('-20,-10,4,6,10,20,25');
9696
expect(tree.root.height).toBe(3);
9797

98-
expect(tree.isNodeBlack(node1)).toBeTruthy();
99-
expect(tree.isNodeRed(node2)).toBeTruthy();
100-
expect(tree.isNodeBlack(node3)).toBeTruthy();
101-
expect(tree.isNodeBlack(node4)).toBeTruthy();
102-
expect(tree.isNodeBlack(node4)).toBeTruthy();
103-
expect(tree.isNodeRed(node5)).toBeTruthy();
104-
expect(tree.isNodeBlack(node6)).toBeTruthy();
105-
expect(tree.isNodeRed(node7)).toBeTruthy();
98+
expect(tree.isNodeBlack(node1)).toBe(true);
99+
expect(tree.isNodeRed(node2)).toBe(true);
100+
expect(tree.isNodeBlack(node3)).toBe(true);
101+
expect(tree.isNodeBlack(node4)).toBe(true);
102+
expect(tree.isNodeBlack(node4)).toBe(true);
103+
expect(tree.isNodeRed(node5)).toBe(true);
104+
expect(tree.isNodeBlack(node6)).toBe(true);
105+
expect(tree.isNodeRed(node7)).toBe(true);
106106
});
107107

108108
it('should balance itself when uncle is red', () => {
@@ -121,15 +121,15 @@ describe('RedBlackTree', () => {
121121
expect(tree.toString()).toBe('-20,-10,2,6,8,10,15,20,25');
122122
expect(tree.root.height).toBe(3);
123123

124-
expect(tree.isNodeBlack(node1)).toBeTruthy();
125-
expect(tree.isNodeRed(node2)).toBeTruthy();
126-
expect(tree.isNodeBlack(node3)).toBeTruthy();
127-
expect(tree.isNodeBlack(node4)).toBeTruthy();
128-
expect(tree.isNodeBlack(node5)).toBeTruthy();
129-
expect(tree.isNodeRed(node6)).toBeTruthy();
130-
expect(tree.isNodeRed(node7)).toBeTruthy();
131-
expect(tree.isNodeRed(node8)).toBeTruthy();
132-
expect(tree.isNodeRed(node9)).toBeTruthy();
124+
expect(tree.isNodeBlack(node1)).toBe(true);
125+
expect(tree.isNodeRed(node2)).toBe(true);
126+
expect(tree.isNodeBlack(node3)).toBe(true);
127+
expect(tree.isNodeBlack(node4)).toBe(true);
128+
expect(tree.isNodeBlack(node5)).toBe(true);
129+
expect(tree.isNodeRed(node6)).toBe(true);
130+
expect(tree.isNodeRed(node7)).toBe(true);
131+
expect(tree.isNodeRed(node8)).toBe(true);
132+
expect(tree.isNodeRed(node9)).toBe(true);
133133

134134
const node10 = tree.insert(4);
135135

@@ -138,16 +138,16 @@ describe('RedBlackTree', () => {
138138

139139
expect(tree.root.value).toBe(node5.value);
140140

141-
expect(tree.isNodeBlack(node5)).toBeTruthy();
142-
expect(tree.isNodeRed(node1)).toBeTruthy();
143-
expect(tree.isNodeRed(node2)).toBeTruthy();
144-
expect(tree.isNodeRed(node10)).toBeTruthy();
145-
expect(tree.isNodeRed(node6)).toBeTruthy();
146-
expect(tree.isNodeRed(node7)).toBeTruthy();
147-
expect(tree.isNodeBlack(node4)).toBeTruthy();
148-
expect(tree.isNodeBlack(node8)).toBeTruthy();
149-
expect(tree.isNodeBlack(node9)).toBeTruthy();
150-
expect(tree.isNodeBlack(node3)).toBeTruthy();
141+
expect(tree.isNodeBlack(node5)).toBe(true);
142+
expect(tree.isNodeRed(node1)).toBe(true);
143+
expect(tree.isNodeRed(node2)).toBe(true);
144+
expect(tree.isNodeRed(node10)).toBe(true);
145+
expect(tree.isNodeRed(node6)).toBe(true);
146+
expect(tree.isNodeRed(node7)).toBe(true);
147+
expect(tree.isNodeBlack(node4)).toBe(true);
148+
expect(tree.isNodeBlack(node8)).toBe(true);
149+
expect(tree.isNodeBlack(node9)).toBe(true);
150+
expect(tree.isNodeBlack(node3)).toBe(true);
151151
});
152152

153153
it('should do left-left rotation', () => {
@@ -162,23 +162,23 @@ describe('RedBlackTree', () => {
162162
expect(tree.toString()).toBe('-10,7,10,15,20');
163163
expect(tree.root.height).toBe(2);
164164

165-
expect(tree.isNodeBlack(node1)).toBeTruthy();
166-
expect(tree.isNodeBlack(node2)).toBeTruthy();
167-
expect(tree.isNodeBlack(node3)).toBeTruthy();
168-
expect(tree.isNodeRed(node4)).toBeTruthy();
169-
expect(tree.isNodeRed(node5)).toBeTruthy();
165+
expect(tree.isNodeBlack(node1)).toBe(true);
166+
expect(tree.isNodeBlack(node2)).toBe(true);
167+
expect(tree.isNodeBlack(node3)).toBe(true);
168+
expect(tree.isNodeRed(node4)).toBe(true);
169+
expect(tree.isNodeRed(node5)).toBe(true);
170170

171171
const node6 = tree.insert(13);
172172

173173
expect(tree.toString()).toBe('-10,7,10,13,15,20');
174174
expect(tree.root.height).toBe(2);
175175

176-
expect(tree.isNodeBlack(node1)).toBeTruthy();
177-
expect(tree.isNodeBlack(node2)).toBeTruthy();
178-
expect(tree.isNodeBlack(node5)).toBeTruthy();
179-
expect(tree.isNodeRed(node4)).toBeTruthy();
180-
expect(tree.isNodeRed(node6)).toBeTruthy();
181-
expect(tree.isNodeRed(node3)).toBeTruthy();
176+
expect(tree.isNodeBlack(node1)).toBe(true);
177+
expect(tree.isNodeBlack(node2)).toBe(true);
178+
expect(tree.isNodeBlack(node5)).toBe(true);
179+
expect(tree.isNodeRed(node4)).toBe(true);
180+
expect(tree.isNodeRed(node6)).toBe(true);
181+
expect(tree.isNodeRed(node3)).toBe(true);
182182
});
183183

184184
it('should do left-right rotation', () => {
@@ -193,23 +193,23 @@ describe('RedBlackTree', () => {
193193
expect(tree.toString()).toBe('-10,7,10,15,20');
194194
expect(tree.root.height).toBe(2);
195195

196-
expect(tree.isNodeBlack(node1)).toBeTruthy();
197-
expect(tree.isNodeBlack(node2)).toBeTruthy();
198-
expect(tree.isNodeBlack(node3)).toBeTruthy();
199-
expect(tree.isNodeRed(node4)).toBeTruthy();
200-
expect(tree.isNodeRed(node5)).toBeTruthy();
196+
expect(tree.isNodeBlack(node1)).toBe(true);
197+
expect(tree.isNodeBlack(node2)).toBe(true);
198+
expect(tree.isNodeBlack(node3)).toBe(true);
199+
expect(tree.isNodeRed(node4)).toBe(true);
200+
expect(tree.isNodeRed(node5)).toBe(true);
201201

202202
const node6 = tree.insert(17);
203203

204204
expect(tree.toString()).toBe('-10,7,10,15,17,20');
205205
expect(tree.root.height).toBe(2);
206206

207-
expect(tree.isNodeBlack(node1)).toBeTruthy();
208-
expect(tree.isNodeBlack(node2)).toBeTruthy();
209-
expect(tree.isNodeBlack(node6)).toBeTruthy();
210-
expect(tree.isNodeRed(node4)).toBeTruthy();
211-
expect(tree.isNodeRed(node5)).toBeTruthy();
212-
expect(tree.isNodeRed(node3)).toBeTruthy();
207+
expect(tree.isNodeBlack(node1)).toBe(true);
208+
expect(tree.isNodeBlack(node2)).toBe(true);
209+
expect(tree.isNodeBlack(node6)).toBe(true);
210+
expect(tree.isNodeRed(node4)).toBe(true);
211+
expect(tree.isNodeRed(node5)).toBe(true);
212+
expect(tree.isNodeRed(node3)).toBe(true);
213213
});
214214

215215
it('should do recoloring, left-left and left-right rotation', () => {
@@ -228,15 +228,15 @@ describe('RedBlackTree', () => {
228228
expect(tree.toString()).toBe('-20,-10,1,6,9,10,15,20,30');
229229
expect(tree.root.height).toBe(3);
230230

231-
expect(tree.isNodeBlack(node1)).toBeTruthy();
232-
expect(tree.isNodeRed(node2)).toBeTruthy();
233-
expect(tree.isNodeBlack(node3)).toBeTruthy();
234-
expect(tree.isNodeBlack(node4)).toBeTruthy();
235-
expect(tree.isNodeBlack(node5)).toBeTruthy();
236-
expect(tree.isNodeRed(node6)).toBeTruthy();
237-
expect(tree.isNodeRed(node7)).toBeTruthy();
238-
expect(tree.isNodeRed(node8)).toBeTruthy();
239-
expect(tree.isNodeRed(node9)).toBeTruthy();
231+
expect(tree.isNodeBlack(node1)).toBe(true);
232+
expect(tree.isNodeRed(node2)).toBe(true);
233+
expect(tree.isNodeBlack(node3)).toBe(true);
234+
expect(tree.isNodeBlack(node4)).toBe(true);
235+
expect(tree.isNodeBlack(node5)).toBe(true);
236+
expect(tree.isNodeRed(node6)).toBe(true);
237+
expect(tree.isNodeRed(node7)).toBe(true);
238+
expect(tree.isNodeRed(node8)).toBe(true);
239+
expect(tree.isNodeRed(node9)).toBe(true);
240240

241241
tree.insert(4);
242242

@@ -257,12 +257,12 @@ describe('RedBlackTree', () => {
257257
expect(tree.toString()).toBe('-20,-10,6,10,20,30');
258258
expect(tree.root.height).toBe(2);
259259

260-
expect(tree.isNodeBlack(node1)).toBeTruthy();
261-
expect(tree.isNodeBlack(node2)).toBeTruthy();
262-
expect(tree.isNodeBlack(node3)).toBeTruthy();
263-
expect(tree.isNodeRed(node4)).toBeTruthy();
264-
expect(tree.isNodeRed(node5)).toBeTruthy();
265-
expect(tree.isNodeRed(node6)).toBeTruthy();
260+
expect(tree.isNodeBlack(node1)).toBe(true);
261+
expect(tree.isNodeBlack(node2)).toBe(true);
262+
expect(tree.isNodeBlack(node3)).toBe(true);
263+
expect(tree.isNodeRed(node4)).toBe(true);
264+
expect(tree.isNodeRed(node5)).toBe(true);
265+
expect(tree.isNodeRed(node6)).toBe(true);
266266

267267
const node7 = tree.insert(25);
268268

@@ -277,13 +277,13 @@ describe('RedBlackTree', () => {
277277
expect(tree.toString()).toBe('-20,-10,6,10,20,25,30');
278278
expect(tree.root.height).toBe(2);
279279

280-
expect(tree.isNodeBlack(node1)).toBeTruthy();
281-
expect(tree.isNodeBlack(node2)).toBeTruthy();
282-
expect(tree.isNodeBlack(node7)).toBeTruthy();
283-
expect(tree.isNodeRed(node4)).toBeTruthy();
284-
expect(tree.isNodeRed(node5)).toBeTruthy();
285-
expect(tree.isNodeRed(node3)).toBeTruthy();
286-
expect(tree.isNodeRed(node6)).toBeTruthy();
280+
expect(tree.isNodeBlack(node1)).toBe(true);
281+
expect(tree.isNodeBlack(node2)).toBe(true);
282+
expect(tree.isNodeBlack(node7)).toBe(true);
283+
expect(tree.isNodeRed(node4)).toBe(true);
284+
expect(tree.isNodeRed(node5)).toBe(true);
285+
expect(tree.isNodeRed(node3)).toBe(true);
286+
expect(tree.isNodeRed(node6)).toBe(true);
287287
});
288288

289289
it('should do left-left rotation with left grand-parent', () => {

‎src/data-structures/trie/__test__/Trie.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ describe('Trie', () => {
4444
trie.addWord('car');
4545
trie.addWord('caption');
4646

47-
expect(trie.doesWordExist('cat')).toBeTruthy();
48-
expect(trie.doesWordExist('cap')).toBeTruthy();
49-
expect(trie.doesWordExist('call')).toBeFalsy();
47+
expect(trie.doesWordExist('cat')).toBe(true);
48+
expect(trie.doesWordExist('cap')).toBe(true);
49+
expect(trie.doesWordExist('call')).toBe(false);
5050
});
5151
});

‎src/data-structures/trie/__test__/TrieNode.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ describe('TrieNode', () => {
55
const trieNode = new TrieNode('c', true);
66

77
expect(trieNode.character).toBe('c');
8-
expect(trieNode.isCompleteWord).toBeTruthy();
8+
expect(trieNode.isCompleteWord).toBe(true);
99
expect(trieNode.toString()).toBe('c*');
1010
});
1111

@@ -35,9 +35,9 @@ describe('TrieNode', () => {
3535
trieNode.addChild('a');
3636
trieNode.addChild('o');
3737

38-
expect(trieNode.hasChild('a')).toBeTruthy();
39-
expect(trieNode.hasChild('o')).toBeTruthy();
40-
expect(trieNode.hasChild('b')).toBeFalsy();
38+
expect(trieNode.hasChild('a')).toBe(true);
39+
expect(trieNode.hasChild('o')).toBe(true);
40+
expect(trieNode.hasChild('b')).toBe(false);
4141
});
4242

4343
it('should suggest next children', () => {

‎src/utils/comparator/__test__/Comparator.test.js

+28-28
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ describe('Comparator', () => {
44
it('should compare with default comparator function', () => {
55
const comparator = new Comparator();
66

7-
expect(comparator.equal(0, 0)).toBeTruthy();
8-
expect(comparator.equal(0, 1)).toBeFalsy();
9-
expect(comparator.equal('a', 'a')).toBeTruthy();
10-
expect(comparator.lessThan(1, 2)).toBeTruthy();
11-
expect(comparator.lessThan(-1, 2)).toBeTruthy();
12-
expect(comparator.lessThan('a', 'b')).toBeTruthy();
13-
expect(comparator.lessThan('a', 'ab')).toBeTruthy();
14-
expect(comparator.lessThan(10, 2)).toBeFalsy();
15-
expect(comparator.lessThanOrEqual(10, 2)).toBeFalsy();
16-
expect(comparator.lessThanOrEqual(1, 1)).toBeTruthy();
17-
expect(comparator.lessThanOrEqual(0, 0)).toBeTruthy();
18-
expect(comparator.greaterThan(0, 0)).toBeFalsy();
19-
expect(comparator.greaterThan(10, 0)).toBeTruthy();
20-
expect(comparator.greaterThanOrEqual(10, 0)).toBeTruthy();
21-
expect(comparator.greaterThanOrEqual(10, 10)).toBeTruthy();
22-
expect(comparator.greaterThanOrEqual(0, 10)).toBeFalsy();
7+
expect(comparator.equal(0, 0)).toBe(true);
8+
expect(comparator.equal(0, 1)).toBe(false);
9+
expect(comparator.equal('a', 'a')).toBe(true);
10+
expect(comparator.lessThan(1, 2)).toBe(true);
11+
expect(comparator.lessThan(-1, 2)).toBe(true);
12+
expect(comparator.lessThan('a', 'b')).toBe(true);
13+
expect(comparator.lessThan('a', 'ab')).toBe(true);
14+
expect(comparator.lessThan(10, 2)).toBe(false);
15+
expect(comparator.lessThanOrEqual(10, 2)).toBe(false);
16+
expect(comparator.lessThanOrEqual(1, 1)).toBe(true);
17+
expect(comparator.lessThanOrEqual(0, 0)).toBe(true);
18+
expect(comparator.greaterThan(0, 0)).toBe(false);
19+
expect(comparator.greaterThan(10, 0)).toBe(true);
20+
expect(comparator.greaterThanOrEqual(10, 0)).toBe(true);
21+
expect(comparator.greaterThanOrEqual(10, 10)).toBe(true);
22+
expect(comparator.greaterThanOrEqual(0, 10)).toBe(false);
2323
});
2424

2525
it('should compare with custom comparator function', () => {
@@ -31,20 +31,20 @@ describe('Comparator', () => {
3131
return a.length < b.length ? -1 : 1;
3232
});
3333

34-
expect(comparator.equal('a', 'b')).toBeTruthy();
35-
expect(comparator.equal('a', '')).toBeFalsy();
36-
expect(comparator.lessThan('b', 'aa')).toBeTruthy();
37-
expect(comparator.greaterThanOrEqual('a', 'aa')).toBeFalsy();
38-
expect(comparator.greaterThanOrEqual('aa', 'a')).toBeTruthy();
39-
expect(comparator.greaterThanOrEqual('a', 'a')).toBeTruthy();
34+
expect(comparator.equal('a', 'b')).toBe(true);
35+
expect(comparator.equal('a', '')).toBe(false);
36+
expect(comparator.lessThan('b', 'aa')).toBe(true);
37+
expect(comparator.greaterThanOrEqual('a', 'aa')).toBe(false);
38+
expect(comparator.greaterThanOrEqual('aa', 'a')).toBe(true);
39+
expect(comparator.greaterThanOrEqual('a', 'a')).toBe(true);
4040

4141
comparator.reverse();
4242

43-
expect(comparator.equal('a', 'b')).toBeTruthy();
44-
expect(comparator.equal('a', '')).toBeFalsy();
45-
expect(comparator.lessThan('b', 'aa')).toBeFalsy();
46-
expect(comparator.greaterThanOrEqual('a', 'aa')).toBeTruthy();
47-
expect(comparator.greaterThanOrEqual('aa', 'a')).toBeFalsy();
48-
expect(comparator.greaterThanOrEqual('a', 'a')).toBeTruthy();
43+
expect(comparator.equal('a', 'b')).toBe(true);
44+
expect(comparator.equal('a', '')).toBe(false);
45+
expect(comparator.lessThan('b', 'aa')).toBe(false);
46+
expect(comparator.greaterThanOrEqual('a', 'aa')).toBe(true);
47+
expect(comparator.greaterThanOrEqual('aa', 'a')).toBe(false);
48+
expect(comparator.greaterThanOrEqual('a', 'a')).toBe(true);
4949
});
5050
});

0 commit comments

Comments
 (0)
Please sign in to comment.