Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 405b47c

Browse files
committed
Revert "Standardised function declaration calls across exercises"
This reverts commit 791a579.
1 parent 8b6d463 commit 405b47c

File tree

4 files changed

+45
-33
lines changed

4 files changed

+45
-33
lines changed

calculator/calculator.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
1-
function add() {}
1+
function add () {
2+
3+
}
24

3-
function subtract() {}
5+
function subtract () {
6+
7+
}
48

5-
function sum() {}
9+
function sum () {
10+
11+
}
612

7-
function multiply() {}
13+
function multiply () {
14+
15+
}
816

9-
function power() {}
17+
function power() {
18+
19+
}
1020

11-
function factorial() {}
21+
function factorial() {
22+
23+
}
1224

1325
module.exports = {
1426
add,

calculator/calculator.spec.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,52 +5,52 @@ describe('add', function() {
55
expect(calculator.add(0,0)).toEqual(0);
66
});
77

8-
xit('adds 2 and 2', function() {
9-
expect(calculator.add(2,2)).toEqual(4);
8+
test.skip('adds 2 and 2', () => {
9+
expect(calculator.add(2,2)).toBe(4);
1010
});
1111

12-
xit('adds positive numbers', function() {
13-
expect(calculator.add(2,6)).toEqual(8);
12+
test.skip('adds positive numbers', () => {
13+
expect(calculator.add(2,6)).toBe(8);
1414
});
1515
});
1616

17-
describe('subtract', function() {
18-
xit('subtracts numbers', function() {
19-
expect(calculator.subtract(10,4)).toEqual(6);
17+
describe('subtract', () => {
18+
test.skip('subtracts numbers', () => {
19+
expect(calculator.subtract(10,4)).toBe(6);
2020
});
2121
});
2222

23-
describe('sum', function() {
24-
xit('computes the sum of an empty array', function() {
25-
expect(calculator.sum([])).toEqual(0);
23+
describe('sum', () => {
24+
test.skip('computes the sum of an empty array', () => {
25+
expect(calculator.sum([])).toBe(0);
2626
});
2727

28-
xit('computes the sum of an array of one number', function() {
29-
expect(calculator.sum([7])).toEqual(7);
28+
test.skip('computes the sum of an array of one number', () => {
29+
expect(calculator.sum([7])).toBe(7);
3030
});
3131

32-
xit('computes the sum of an array of two numbers', function() {
33-
expect(calculator.sum([7,11])).toEqual(18);
32+
test.skip('computes the sum of an array of two numbers', () => {
33+
expect(calculator.sum([7,11])).toBe(18);
3434
});
3535

36-
xit('computes the sum of an array of many numbers', function() {
37-
expect(calculator.sum([1,3,5,7,9])).toEqual(25);
36+
test.skip('computes the sum of an array of many numbers', () => {
37+
expect(calculator.sum([1,3,5,7,9])).toBe(25);
3838
});
3939
});
4040

41-
describe('multiply', function() {
42-
xit('multiplies two numbers', function() {
43-
expect(calculator.multiply([2,4])).toEqual(8);
41+
describe('multiply', () => {
42+
test.skip('multiplies two numbers', () => {
43+
expect(calculator.multiply([2,4])).toBe(8);
4444
});
4545

46-
xit('multiplies several numbers', function() {
47-
expect(calculator.multiply([2,4,6,8,10,12,14])).toEqual(645120);
46+
test.skip('multiplies several numbers', () => {
47+
expect(calculator.multiply([2,4,6,8,10,12,14])).toBe(645120);
4848
});
4949
});
5050

51-
describe('power', function() {
52-
xit('raises one number to the power of another number', function() {
53-
expect(calculator.power(4,3)).toEqual(64); // 4 to third power is 64
51+
describe('power', () => {
52+
test.skip('raises one number to the power of another number', () => {
53+
expect(calculator.power(4,3)).toBe(64); // 4 to third power is 64
5454
});
5555
});
5656

fibonacci/fibonacci.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
const fibonacci = function () {};
22

3-
module.exports = fibonacci;
3+
module.exports = fibonacci

findTheOldest/findTheOldest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
let findTheOldest = function () {};
2-
1+
let findTheOldest = function() {
2+
}
33
module.exports = findTheOldest;

0 commit comments

Comments
 (0)