Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Feat/testing #8

wants to merge 6 commits into from

Conversation

gonzaloconcha
Copy link

  • 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 () => {
Copy link
Contributor

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.

Copy link
Author

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);
Copy link
Contributor

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.

Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants