Skip to content

Instantly share code, notes, and snippets.

@kelvinndmo
Created February 14, 2020 13:33
Show Gist options
  • Save kelvinndmo/38c554e739f6d9e1878bc57b5fe474e4 to your computer and use it in GitHub Desktop.
Save kelvinndmo/38c554e739f6d9e1878bc57b5fe474e4 to your computer and use it in GitHub Desktop.
const {add, substract, multiplication, division,modulo} = require("../math")
test('should add two number and return sum', () => {
const sum = add(10, 10)
expect(sum).toEqual('sum is 20')
});
test('should substract two number and return difference', () => {
const difference = substract(20, 10)
expect(difference).toEqual(10)
});
test('should divide two number are return result', () => {
const result = division(20,10)
expect(result).toEqual(2)
});
test('should multiplication of two numbers', () => {
const multiply = multiplication(2,2)
expect(multiply).toBe(4)
});
test('should return modulo', () => {
const modulus = modulo(5,2)
expect(modulus).toBe(1)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment