-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/testing #8
base: master
Are you sure you want to change the base?
Feat/testing #8
Conversation
gonzaloconcha
commented
Jun 5, 2022
- Se creó tests para la ruta usuarios, para los metodos GET, POST y DELETE
- Se cambio los tests que vienen por defecto a esperar status code 404
- Se creó una seeds para usuarios para la base de datos tests
- Se agregó a package.json comandos para usar la base de datos de tests con migraciones y seeds la cual se resetea cada vez que se ejecutan los tests.
- Se instaló cross-env para realizar los tests con seeds, yarn install es requerido.
it('should have status 201', async () => { | ||
expect(response.status).toBe(201); | ||
}); | ||
it('should have created a user', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No estoy seguro de este test, siento que con el post anterior retornado un 201 debería quedar claro que se creo un usuario.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lo mismo que dije abajo, para asegurarse que el mensaje sea concordante con la información entregada
}); | ||
|
||
it('should have status 200', async () => { | ||
expect(response.status).toBe(200); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Siento que este con el de abajo se podrían juntar en uno nomás.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tal vez la primera vez lo haría sí y el resto lo juntamos. Así pueden ver que tan precisos pueden ser si es necesario.