Skip to content

Commit 2d0fab7

Browse files
author
Mohamad Farhani
authored
Merge pull request #1 from so0oshiance/multiply
Multiply
2 parents 4e189aa + 2fa2cb3 commit 2d0fab7

File tree

4 files changed

+346
-12
lines changed

4 files changed

+346
-12
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
language: node_js
2+
node_js:
3+
- 7

index.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
'use strict';
22

33
function add(a, b) {
4-
return a + b;
4+
return a + b;
55
}
66

77
function subtract(a, b) {
8-
return a - b;
8+
return a - b;
99
}
1010

1111
function divide(a, b) {
12-
return a / b;
12+
return a / b;
13+
}
14+
function multiply(a, b) {
15+
return a * b;
1316
}
1417

1518
module.exports = {
16-
add,
17-
subtract,
18-
divide
19-
};
19+
add,
20+
subtract,
21+
divide,
22+
multiply
23+
};

package-lock.json

Lines changed: 320 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
'use strict';
22

3-
const {assert} = require('chai');
3+
const { assert } = require('chai');
4+
const { multiply } = require('../');
45

56
describe('multiply()', () => {
6-
it('should multiply positive numbers together');
7+
it('should multiply positive numbers together', () => {
8+
assert.equal(multiply(2, 3), 6);
9+
});
710

8-
it('should multiply positive and negative numbers together');
11+
it('should multiply positive and negative numbers together', () => {
12+
assert.equal(multiply(2, -3), -6);
13+
});
914

10-
it('should multiply negative numbers together');
11-
});
15+
it('should multiply negative numbers together', () => {
16+
assert.equal(multiply(-2, -3), 6);
17+
});
18+
});

0 commit comments

Comments
 (0)