Skip to content

edvijaka/greeter-tdd-kata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

Ton install, run npm i.

To run the tests, run npm run watch.

Workflow of TDD

  1. Write a failing test. Stop writing the test as soon as it fails.
  2. Write the minimal production code required for the test to pass. Stop writing any code once the test passes.
  3. Refactor the test code and the production code without altering the functionality. All tests should pass.

Greeter Kata

Before you start:

  • Try not to read ahead.
  • Do one task at a time. The trick is to learn to work incrementally.

All tests should always pass, regardless of environment conditions.

The task:

  1. Write a Greeter class with greet function that receives a name as input and outputs Hello <name>. The signature of greet should not change throughout the kata. You are allowed to construct Greeter object as you please.
  2. greet trims the input
  3. greet capitalizes the first letter of the name
  4. greet returns Good morning <name> when the time is 06:00-12:00
  5. greet returns Good evening <name> when the time is 18:00-22:00
  6. greet returns Good night <name> when the time is 22:00-06:00

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published