diff --git a/math.js b/math.js index 0b32465..c942f89 100644 --- a/math.js +++ b/math.js @@ -6,4 +6,12 @@ function subtract(a, b) { return a - b; } -module.exports = { add, subtract }; +function multiply(a, b) { + return a * b; +} + +function divide(a, b) { + return a / b; +} + +module.exports = { add, subtract, multiply, divide }; diff --git a/math.test.js b/math.test.js index 2673c61..e1ec80d 100644 --- a/math.test.js +++ b/math.test.js @@ -1,4 +1,4 @@ -const { add, subtract } = require("./math"); +const { add, subtract, multiply, divide } = require("./math"); it("should add two numbers", () => { expect(add(1, 2)).toBe(3); @@ -7,3 +7,11 @@ it("should add two numbers", () => { it("should subtract two numbers", () => { expect(subtract(1, 2)).toBe(-1); }); + +it("should multiply two numbers", () => { + expect(multiply(2, 3)).toBe(6); +}); + +it("should divide two numbers", () => { + expect(divide(1, 2)).toBe(0.5); +});