Skip to content

Latest commit

 

History

History

tennis-refactoring-kata

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Tennis refactoring kata

Goal

  • Refactor the code to reduce the complexity and improve the readability

Tennis rules

You can read more about Tennis scores here which is summarized below:

  • A game is won by the first player to have won at least four points in total and at least two points more than the opponent.
  • The running score of each game is described in a manner peculiar to tennis: scores from zero to three points are described as "Love", "Fifteen", "Thirty", and "Forty" respectively.
  • If at least three points have been scored by each player, and the scores are equal, the score is "Deuce".
  • If at least three points have been scored by each side and a player has one more point than his opponent, the score of the game is "Advantage" for the player in the lead.

How to test

Install the dependencies the first time

npm install

To execute the tests once

npm test

or to have the tests all the time running

npm run test-watch

Inspired by

Emily Bache https://github.com/emilybache/Tennis-Refactoring-Kata