Obtuve una función que recibe dos números (entero), devolviendo una matriz con los primeros (números) múltiplos de (valor) como countBy (valor, número).
p.ej
countBy(1, 10) returns [1, 2, 3, 4, 5, 5, 7, 8, 9, 10]
countyBy(2, 5) returns [2, 4, 6, 8, 10]
Entonces, ¿qué comparador debería usarse para probar si la función recibe solo números (entero)? Hice muchas pruebas pero aún no encontré una solución.
it ('Verify if are received and returned only numbers', () => { expect(typeof countBy(2, 5)).toBe('number'); });¿Alguien puede darme una luz?
prueba esto
const targetArray = [1, 2, 3, 4, 5, 5, 7, 8, 9, 10]; test("Verify if are received and returned only numbers", () => { targetArray.forEach((target) => { expect(typeof target).toBe("number"); }); });