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

[Semana 1 - TDD] Resolução do exercício #32

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

helloLari
Copy link

  • Adicionei um arquivo com a resolução do exercício e outro arquivo para testar as funcionalidades do objeto;
    
  • Adicionei casos de testes unitários utilizando a abordagem Red - Green - Refactor com jest;
    

Copy link

@CintiaMacchia CintiaMacchia left a 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 {

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) {

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;

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
});

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.

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.

None yet

2 participants