-
Notifications
You must be signed in to change notification settings - Fork 35
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
[Semana 1 - TDD] Resolução do exercício #32
base: main
Are you sure you want to change the base?
Conversation
helloLari
commented
Sep 20, 2023
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.
Que código lindo! É bom poder ver implementações bem feitas e poder aprender com elas.
@@ -0,0 +1,39 @@ | |||
class BankAccount { |
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.
Primeira coisa que notei de perfeito, e eu sempre esqueço, tentar usar os nomes em inglês, principalmente porque no mercado acredito que seja assim.
this.balance += amount; | ||
} | ||
|
||
withdraw(amount) { |
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.
Muito boa implementação, fácil de entender.
} | ||
|
||
module.exports = BankAccount; | ||
|
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.
Código limpo, bem estruturado e com ótimas práticas.
expect(spy).toHaveBeenCalledWith('Saldo insuficiente para saque.'); | ||
spy.mockRestore(); // Restaura a função console.log após o teste | ||
}); | ||
|
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.
Código muito bem escrito, inclusive o uso de métodos diferentes do Jest.