-
Notifications
You must be signed in to change notification settings - Fork 296
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
tests: ensure jest test are running #35
Conversation
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.
Reviewed and ok
Testando aqui, tive uns problemas com windows e to tentando replicar no ubuntu |
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.
Obrigado pelo pull-request @Luc-cpl
test/e2e/suplies.spec.ts
Outdated
|
||
describe('AppController (e2e)', () => { | ||
describe('Supplies (e2e)', () => { |
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.
Poderias remover esse teste? Ele vai falhar a depender da configuração do banco.
Uma outra alternativa era criar um ' health check' endpoint e mudar esse teste para apontar para o mesmo . Assim continuariamos tendo um exemplo de teste 'e2e' funcionando.
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.
Sim, esse endpoint está ai só para manter o exemplo para os testes e2e para quem for usar.
Não gostaria de remover enquanto não temos outros testes nessa área (para manter o exemplo).
O correto na realidade seria o teste não falhar por conta do DB.
Não sei ao certo como é essa parte com o Prisma (nunca usei ele), mas acredito que o ideal seria a suite de testes inicializar um DB limpo e "resetar" as tabelas a cada teste para ter algo mais previsível.
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.
Oi @Luc-cpl. No momento esse 'test' está falhando para qualquer desenvolvedor que tenha alguma instancia local rodando com dados.
No futuro podemos vir a consertar isso. Todavia, no momento o seu PR não conserta todas as falhas como está proposto no PR: 'tests: ensure jest test are running
'.
Daí a sugestão para:
- Ou remover esse test. Ou adicionar um 'health-check' para ter um test e2e rodando.
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.
Ok, daqui a pouco faço a alteração.
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.
@AlbuquerqueRafael
Como pode ver, mantive o teste mas removi a checagem da resposta para evitar o erro (com um aviso de @todo
para fazer essa parte futuramente, assim é feita apenas a verificação da resposta 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.
-
Aqui os testes falharam também no
Supplies (e2e)
.
Aquele mesmo erro referente à porta da URL. -
Typo em
suplies.spec.ts
o correto é:
supplies.spec.ts
-
Corrigir o conflito na
package.json
Corrigidos os itens 2 e 3. |
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.
falta mockar o banco apenas
…ts/working-jest-base
Desnecessário após merge do #78 |
This pull request resolves failing Jest tests by fixing configurations and addressing unresolved dependencies, enabling thorough testing of the codebase.