From 416b4542d2e988c4b5e51aa5cd6d4564ff76175d Mon Sep 17 00:00:00 2001 From: Marcos Schead Date: Tue, 28 Oct 2025 11:21:12 -0300 Subject: [PATCH 1/2] feat: added new math operations (one test will fail) --- math.js | 10 +++++++++- math.test.js | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) 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..470f7c5 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(5); +}); + +it("should divide two numbers", () => { + expect(divide(1, 2)).toBe(0.5); +}); From 83b399662c57be5d72ab893779e961431c9cc1a7 Mon Sep 17 00:00:00 2001 From: Marcos Schead Date: Tue, 28 Oct 2025 12:04:53 -0300 Subject: [PATCH 2/2] feat: added new math operations (test fixed) --- math.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/math.test.js b/math.test.js index 470f7c5..e1ec80d 100644 --- a/math.test.js +++ b/math.test.js @@ -9,7 +9,7 @@ it("should subtract two numbers", () => { }); it("should multiply two numbers", () => { - expect(multiply(2, 3)).toBe(5); + expect(multiply(2, 3)).toBe(6); }); it("should divide two numbers", () => {