📝 Added sandbox (code sketchbook)
This commit is contained in:
parent
b475595f7f
commit
b5daf18b1a
142 changed files with 100702 additions and 0 deletions
22
sandbox/jest/test/calculator.test.js
Normal file
22
sandbox/jest/test/calculator.test.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
const mathOperations = require('../calculator')
|
||||
|
||||
describe("Calculator tests", () => {
|
||||
test('adding 1 + 2 should return 3', () => {
|
||||
// arrange and act
|
||||
expect(mathOperations.sum(1,2)).toBe(3)
|
||||
})
|
||||
|
||||
test("subtracting 2 from 10 should return 8", () => {
|
||||
// arrange and act
|
||||
let result = mathOperations.diff(10,2)
|
||||
// assert
|
||||
expect(result).toBe(8)
|
||||
})
|
||||
|
||||
test("multiplying 2 and 8 should return 16", () => {
|
||||
// arrange and act
|
||||
let result = mathOperations.product(2,8)
|
||||
// assert
|
||||
expect(result).toBe(16)
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue