Skip to content

Instantly share code, notes, and snippets.

@jaamaalxyz
Created August 11, 2018 09:34
Show Gist options
  • Save jaamaalxyz/4cba8b39eea08eda98c76b787775bc63 to your computer and use it in GitHub Desktop.
Save jaamaalxyz/4cba8b39eea08eda98c76b787775bc63 to your computer and use it in GitHub Desktop.
const assert = require('assert');
const operations = require('./operations');
// Test case for add()
it('should calculates the sum of 1 and 3', () => {
assert.equal(operations.add(1, 3), 4)
});
// Test case for add()
it('should return -2 to for added -1 and -1', () => {
assert.equal(operations.add(-1, -1), -2)
});
// Test case for subtract()
it('should return 30 when subtract from 33 to 3', () => {
assert.equal(operations.subtract(33, 3), 30)
});
// Test case for multiply()
it('should return 20 when 5 multiplied by 4', () => {
assert.equal(operations.multiply(5, 4), 20)
});
// Test case for divide()
it('should return 2 when 10 divide by 5', () => {
assert.equal(operations.divide(10, 5), 2)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment