Introduccion
¿Qué es el testing?
La piramide del testing
Hablemos sobre deuda técnica
Herremientas de testing
Creando el proyecto
Tu primer test
Escribiendo pruebas
Pruebas estáticas
Assertions / matchers
Setup and Teardown
Implementado Setup
Tipos de pruebas
Metodologías
Pruebas Unitarias
Pruebas unitarias
Coverage report
Instalación de Docker para este curso
Proyecto de API
Mocking, Stub, doubles
Mocking
Spies
Generando Fake Books
Integration Test & E2E
Configurando supertest en el API
Integration Test
e2e
UI Test
UI Test
Automatizar
Unit tests en GitHubActions
E2E en GitHubActions
¿Quieres más cursos de testing?
No tienes acceso a esta clase
¡Continúa aprendiendo! Únete y comienza a potenciar tu carrera
Aportes 2
Preguntas 2
Les comparto un test de promedio:
02-math.js
Cree una función que recibe un array donde valida que no vaya vacio.
const average = (values) => {
const valuesLength = values.length
if(valuesLength === 0) return null
const totalValues = values.reduce((a, b) => a + b, 0)
return totalValues / valuesLength
}
02-math.test.js
Cree dos test, el primero valida que calcule correctamente el promedio de un array de elementos y el otro que retorne null al ser un array vacio.
test("Average 2, 3, 3, 5, 7 and 10", () => {
const values = [2, 3, 3, 5, 7, 10];
const result = average(values)
expect(result).toBe(5)
});
test("Should average for 0", () => {
const result = average([])
expect(result).toBe(null)
})
Los aportes, preguntas y respuestas son vitales para aprender en comunidad. Regístrate o inicia sesión para participar.