This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Resposta no fórum Rocketseat (https://app.rocketseat.com.br/h/forum/node-js/9085625a-3d2e-4f88-8604-a02096bfe3bd) | |
// Se você for fazer o Teste Unitário, teste cada função. Teste os casos extremos, de sucesso e erro. Pense em erros óbvios que você quer evitar, depois em casos mais raros. | |
// Exemplo: na função "criar novo prato", se for obrigatório pelo menos 1 tag, 1 ingrediente, você poderia se basear no "esboço" abaixo para começar um dos testes; | |
if(!userId || !name || !description || !instructions) { | |
// falha no teste, mostra o erro "campos obrigatórios não foram preenchidos!" | |
return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pergunta no FÓRUM: https://app.rocketseat.com.br/h/forum/node-js/9085625a-3d2e-4f88-8604-a02096bfe3bd | |
// Código: https://github.com/andregparada/cookbook/blob/main/prisma/schema.prisma | |
// Entre em https://jsoncrack.com/editor, clique em File -> Importar. Peque o código abaixo. Apague os comentários. | |
{ | |
"id": "...", | |
"name": "João Gomes", | |
"email": "[email protected]", | |
"password_hash": "***", | |
"role": "ADMIN", |