Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 571834a

Browse files
fix(test): refactor tests
1 parent 8cd126d commit 571834a

16 files changed

+27
-27
lines changed

‎book/interview-questions/daily-temperatures.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ describe('Stack: Daily Temperatures', () => {
66
expect(dailyTemperatures([30, 28, 50, 40, 30])).toEqual([2, 1, 0, 0, 0]);
77
});
88

9-
it('should work', () => {
9+
it('should work 2', () => {
1010
expect(dailyTemperatures([73, 74, 75, 71, 69, 72, 76, 73])).toEqual([1, 1, 4, 2, 1, 1, 0, 0]);
1111
});
1212

13-
it('should work', () => {
13+
it('should work 3', () => {
1414
expect(dailyTemperatures([89, 62, 70, 58, 47, 47, 46, 76, 100, 70])).toEqual([8, 1, 5, 4, 3, 2, 1, 1, 0, 0]);
1515
});
1616

‎book/interview-questions/linkedlist-flatten-multilevel.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const ll = (nums) => Array.from(new LinkedList(nums, Node));
4646
expect(toString(fn(l3[0]))).toEqual('{ 21(,) -> 23(21,) -> 36(23,) -> 37(36,) }');
4747
});
4848

49-
fit('works with flat 2 levels and reminder', () => {
49+
it('works with flat 2 levels and reminder', () => {
5050
// 1--- 2--- 3
5151
// |
5252
// 36--37

‎book/interview-questions/linkedlist-same-data.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('Linked List: has same data', () => {
2020
expect(hasSameData(l1, l2)).toEqual(true);
2121
});
2222

23-
it('should work with different data', () => {
23+
it('should work with different data separated', () => {
2424
const l1 = new LinkedList(['he', 'll', 'o']).first;
2525
const l2 = new LinkedList(['ho', 'la']).first;
2626
expect(hasSameData(l1, l2)).toEqual(false);

‎book/interview-questions/max-subarray.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ const largeArray = require('./max-subarray.data');
44
describe('Max Subarray Sum', () => {
55
[maxSubArray, maxSubArrayBrute1, maxSubArrayBrute2].forEach((fn) => {
66
describe(`with ${fn.name}`, () => {
7-
it('should work with small arrays', () => {
7+
it('should work with large arrays', () => {
88
expect(fn([-2, 1, -3, 4, -1, 2, 1, -5, 4])).toEqual(6);
99
});
1010

1111
it('should work with small arrays', () => {
1212
expect(fn([1, -3, 10, -5])).toEqual(10);
1313
});
1414

15-
it('should work with large arrays', () => {
15+
it('should work with humongous arrays', () => {
1616
expect(fn(largeArray)).toEqual(4853);
1717
});
1818
});

‎book/interview-questions/merge-intervals.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const { merge } = require('./merge-intervals');
2121
expect(actual).toEqual(expected);
2222
});
2323

24-
it('should work with other case', () => {
24+
it('should work with other case with large numbers', () => {
2525
const actual = fn([[10, 99], [20, 50], [9, 11], [98, 100]]);
2626
const expected = [[9, 100]];
2727
expect(actual).toEqual(expected);

‎book/interview-questions/merge-lists.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('Linked List: Merge Lists', () => {
2626
expect(asString(actual)).toEqual(expected);
2727
});
2828

29-
it('should handle empty list 1', () => {
29+
it('should handle empty list 2', () => {
3030
const l1 = new LinkedList([2, 3, 4]).first;
3131
const l2 = new LinkedList().first;
3232
const actual = mergeTwoLists(l1, l2);

‎book/interview-questions/most-common-words-ii.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ const { mostCommonWords, mostCommonWordsBrute } = require('./most-common-words-i
99
)).toEqual(['keys']);
1010
});
1111

12-
it('should work', () => {
12+
it('should work 2', () => {
1313
expect(fn(
1414
'Look at it! What is it? It does look like my code from 1 year ago',
1515
2,
1616
)).toEqual(['it', 'look']);
1717
});
1818

19-
it('should work', () => {
19+
it('should work all puntuations', () => {
2020
expect(fn(
2121
'a; a,b, a\'s c a!; b,b, c.',
2222
4,

‎book/interview-questions/network-delay-time.spec.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎book/interview-questions/sort-colors.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ const { sortColors, sortColorsCompact } = require('./sort-colors');
1717
expect(actual).toEqual(expected);
1818
});
1919

20-
it('should work with small case', () => {
20+
it('should work with small case1', () => {
2121
const actual = [2, 1, 2];
2222
fn(actual);
2323
const expected = [1, 2, 2];
2424
expect(actual).toEqual(expected);
2525
});
2626

27-
it('should work with small case', () => {
27+
it('should work with small case2', () => {
2828
const actual = [1, 0, 2];
2929
fn(actual);
3030
const expected = [0, 1, 2];
3131
expect(actual).toEqual(expected);
3232
});
3333

34-
it('should work with small case', () => {
34+
it('should work with small case3', () => {
3535
const actual = [2, 0, 1];
3636
fn(actual);
3737
const expected = [0, 1, 2];

‎src/data-structures/custom/lru-cache.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('LRU Cache', () => {
99
expect(c).toBeDefined();
1010
});
1111

12-
it('should initialize', () => {
12+
it('should initialize with capacity', () => {
1313
c = new LRUCache(7);
1414
expect(c.capacity).toEqual(7);
1515
});

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /