Regla 0: La BD de producci贸n esta sobre todas las cosas, NO SE TOCA BAJO NINGUNA CIRCUNSTANCIA
Requisitos
驴Qu茅 necesitas para aprender Testing E2E con Node.js?
Introducci贸n: pruebas e2e con Node.js
Explorando la API
Explorando el c贸digo del proyecto
Instalando y configurando Jest con Node
Tu primer prueba e2e
Buenas pr谩cticas en pruebas E2E
Pruebas a la API de Fake Store
Configurando el entorno de pruebas para nuestro proyecto
Coverage Report
Pruebas a Schemas o DTOs
Pruebas a endpoints GET
Pruebas al Login
Pruebas a rutas con protecci贸n
Pruebas a rutas con accessToken
Pruebas a endpoints POST
Pruebas en Entornos de Desarrollo Avanzados
驴Crear bases de datos solo para pruebas?
Preparando el ambiente de pruebas e2e
Creando un seed de datos manual
Seed de datos con sequelize
Umzug: corriendo los seeds de datos para pruebas e2e
Pruebas a crear categor铆as
Pruebas al endpoint de producto
Pruebas a la paginaci贸n
Mocking y automatizaci贸n
Mocking en Node.js
Automatizacion en GitHub Actions
Pr贸ximos pasos
驴Quieres m谩s cursos de testing?
You don't have access to this class
Keep learning! Join and start boosting your career
Imagine that you are creating tests for your API and you find that when you run a set of tests, you get inconsistent results. This is because the database does not allow the creation of multiple users with the same email. This behavior is normal for the API, but it complicates writing tests. Next, we will discuss how to solve this problem without affecting other tests.
End-to-end tests simulate the flow of a system from user input to final response, verifying the interaction of all components. These tests are crucial, as they are more comprehensive than integration tests by covering all components, from the controller to the database.
To maintain the integrity of your tests and ensure that data does not interfere with each other, follow these rules:
Imagine that when testing functions for products, you are left with interference in the purchase order tests. This happens when tests do not have a separate data environment. To avoid this, follow these steps:
Automate test data: create a dataset for each individual test and delete it after completion.
Run tests with a new dataset: Before starting a test set, run a data seed. Upon completion of the tests, delete this seed.
This methodology ensures that each test file has its own isolated data, avoiding conflicts between tests.
Data seeds help to start each test with fresh data:
In the professional world, test data automation is crucial to maintain test integrity and ensure consistent results. By using independent information seeds for each test, conflicts are eliminated and the quality of development is improved.
Continue learning and improving your professional skills through advanced software testing practices!
Contributions 3
Questions 0
Regla 0: La BD de producci贸n esta sobre todas las cosas, NO SE TOCA BAJO NINGUNA CIRCUNSTANCIA
Want to see more contributions, questions and answers from the community?