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 c2d026b

Browse files
Алексей ПоповАлексей Попов
Алексей Попов
authored and
Алексей Попов
committed
test: add tests for some solutions
1 parent 0b57496 commit c2d026b

7 files changed

+14
-14
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
/**
22
* @description Initialize queue as an array
33
*/
4-
var MyQueue = function() {
4+
const MyQueue = function() {
55
this.queue = [];
66
};
77

8-
/**
8+
/**
99
* @description Pushes value to the back of the queue
1010
* @param {Number} value
1111
* @return {Void}
1212
*/
13-
MyQueue.prototype.push = function(value) {
13+
MyQueue.prototype.push = function(value) {
1414
this.queue.push(value);
1515
};
1616

1717
/**
1818
* @description Removes the element from the front of the queue and returns it
1919
* @return {Number}
2020
*/
21-
MyQueue.prototype.pop = function() {
21+
MyQueue.prototype.pop = function() {
2222
return this.queue.shift();
2323
};
2424

2525
/**
2626
* @description Returns the element at the front of the queue
2727
* @return {Number}
2828
*/
29-
MyQueue.prototype.peek = function() {
29+
MyQueue.prototype.peek = function() {
3030
const [elem] = this.queue;
3131
return elem;
3232
};
@@ -35,6 +35,6 @@ MyQueue.prototype.peek = function() {
3535
* @description Returns true if the queue is empty
3636
* @return {Boolean}
3737
*/
38-
MyQueue.prototype.empty = function() {
38+
MyQueue.prototype.empty = function() {
3939
return this.queue.length === 0;
4040
};

‎tests/0268_missing_number.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ describe('Testing "missingNumber" function', () => {
66
expect(missingNumber([3, 0, 1])).toEqual(2);
77
expect(missingNumber([0, 1])).toEqual(2);
88
});
9-
});
9+
});

‎tests/0326_power_of_three.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ describe('Testing "isPowerOfThree" function', () => {
66
expect(isPowerOfThree(27)).toBeTruthy();
77
expect(isPowerOfThree(0)).toBeFalsy();
88
});
9-
});
9+
});

‎tests/0342_power_of_four.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ describe('Testing "isPowerOfFour" function', () => {
77
expect(isPowerOfFour(5)).toBeFalsy();
88
expect(isPowerOfFour(1)).toBeTruthy();
99
});
10-
});
10+
});

‎tests/0367_valid_perfect_square.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ describe('Testing "validPerfectSquare" function', () => {
66
expect(validPerfectSquare(16)).toBeTruthy();
77
expect(validPerfectSquare(14)).toBeFalsy();
88
});
9-
});
9+
});

‎tests/0421_maximum_xor_of_two_numbers_in_an_array.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import findMaximumXOR from '../js_solutions/0421_maximum_xor_of_two_numbers_in_a
33

44
describe('Testing "findMaximumXOR" function', () => {
55
test('Testing overall perfomance', () => {
6-
expect(findMaximumXOR([3,10,5,25,2,8])).toEqual(28);
7-
expect(findMaximumXOR([14,70,53,83,49,91,36,80,92,51,66,70])).toEqual(127);
6+
expect(findMaximumXOR([3,10,5,25,2,8])).toEqual(28);
7+
expect(findMaximumXOR([14,70,53,83,49,91,36,80,92,51,66,70])).toEqual(127);
88
});
9-
});
9+
});

‎tests/1287_element_appearing_more_than_25_in_sorted_array.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import findSpecialInteger from '../js_solutions/1287_element_appearing_more_than
33

44
describe('Testing "findSpecialInteger" function', () => {
55
test('Testing overall perfomance', () => {
6-
expect(findSpecialInteger([1,2,2,6,6,6,6,7,10])).toEqual(6);
6+
expect(findSpecialInteger([1,2,2,6,6,6,6,7,10])).toEqual(6);
77
expect(findSpecialInteger([1, 1])).toEqual(1);
88
});
99
});

0 commit comments

Comments
(0)

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