forked from bakoliasn/basic-javascript-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultiplyTwoNumbers.js
More file actions
25 lines (19 loc) · 803 Bytes
/
Copy pathmultiplyTwoNumbers.js
File metadata and controls
25 lines (19 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var expect = require('chai').expect;
var multiplyTwoNumbers = require('../workshop').multiplyTwoNumbers;
describe('multiplyTwoNumbers', function() {
it('Should return 42 when passed 7 and 6', function() {
expect(multiplyTwoNumbers(7, 6)).to.equal(42);
});
it('Should return undefined if passed something else than numbers', function() {
expect(multiplyTwoNumbers('hello', 'world')).to.equal(undefined);
});
it('Should work with negative numbers', function() {
expect(multiplyTwoNumbers(-1, -1)).to.equal(1);
});
it('Should work with zero', function() {
expect(multiplyTwoNumbers(0, 10)).to.equal(0);
});
it('Should work with Infinity', function() {
expect(multiplyTwoNumbers(42, Infinity)).to.equal(Infinity);
});
});