Skip to content

Commit 54ef710

Browse files
committed
add e2e test for CI
1 parent 7b7cc99 commit 54ef710

51 files changed

Lines changed: 2813 additions & 9 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

code_to_optimize_js/tests/bubble_sort.test.js renamed to code_to_optimize/js/code_to_optimize_js/tests/bubble_sort.test.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,29 @@ describe('bubbleSort', () => {
3030
bubbleSort(original);
3131
expect(original).toEqual([3, 1, 2]);
3232
});
33+
34+
test('sorts a larger reverse sorted array for performance', () => {
35+
const input = [];
36+
for (let i = 500; i >= 0; i--) {
37+
input.push(i);
38+
}
39+
const result = bubbleSort(input);
40+
expect(result[0]).toBe(0);
41+
expect(result[result.length - 1]).toBe(500);
42+
});
43+
44+
test('sorts a larger random array for performance', () => {
45+
const input = [
46+
42, 17, 93, 8, 67, 31, 55, 22, 89, 4,
47+
76, 12, 39, 58, 95, 26, 71, 48, 83, 19,
48+
64, 3, 88, 37, 52, 11, 79, 46, 91, 28,
49+
63, 7, 84, 33, 57, 14, 72, 41, 96, 24,
50+
69, 6, 81, 36, 54, 16, 77, 44, 90, 29
51+
];
52+
const result = bubbleSort(input);
53+
expect(result[0]).toBe(3);
54+
expect(result[result.length - 1]).toBe(96);
55+
});
3356
});
3457

3558
describe('bubbleSortDescending', () => {

code_to_optimize_js/tests/e2e-behavior-comparison.test.js renamed to code_to_optimize/js/code_to_optimize_js/tests/e2e-behavior-comparison.test.js

File renamed without changes.

code_to_optimize_js/tests/e2e-comparison-test.js renamed to code_to_optimize/js/code_to_optimize_js/tests/e2e-comparison-test.js

File renamed without changes.

0 commit comments

Comments
 (0)