-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
test-5.js
27 lines (22 loc) · 703 Bytes
/
test-5.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// test-5.js
const { suma, resta } = require( './funcionesMatematicas' )
test( 'Suma 2 números positivos correctamente', () => {
const resultado = suma( 2, 3 )
const esperado = 5
expect( resultado ).toBe( esperado )
} )
test( 'Suma 2 números negativos correctamente', () => {
const resultado = suma( -2, -3 )
const esperado = -5
expect( resultado ).toBe( esperado )
} )
test( 'Resta 2 números positivos correctamente', () => {
const resultado = resta( 8, 3 )
const esperado = 5
expect( resultado ).toBe( esperado )
} )
test( 'Resta 2 números negativos correctamente', () => {
const resultado = resta( -8, -3 )
const esperado = -5
expect( resultado ).toBe( esperado )
} )