Here's the original idea of test && commit || revert by Kent Beck.
This is a starter project for a coding kata using test && commit || revert
and TypeScript; where TCR is enforced as a Git pre-commit hook.
Note: Although, this kata template is using a pre-commit hook, the use of pre-commit hooks has major downsides and is often a focus on the "wrong thing"; cf. Pre-commit: Don't git hooked! by Matt Riley.
Install dependencies with npm i
, pnpm i
, or yarn install
(Husky hooks should be installed)
- Commit often
- Use Git as you are used to (the pre-commit hook will be executed)
- Use
npm run tcr
to commit (it will executetest && commit || revert
) - Use
npm run tcr-timeboxed 5
to continuouslytest && commit || revert
in5
minute intervalls- combine the exercise with
npm run tcr
ornpm run tc
(without reset) to commit early - cancel with
ctrl+c
- combine the exercise with
This kata template was created by Andrej Dyck, here is the original repository: https://github.com/andrej-dyck/kata-template-tcr
This kata was created by Emily Bache. Yo can check the original version: https://github.com/emilybache/Tennis-Refactoring-Kata
Tennis has a rather quirky scoring system, and to newcomers it can be a little difficult to keep track of. The tennis society has contracted you to build a scoreboard to display the current score during tennis games.
You can read more about Tennis scores on wikipedia 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.
You need only report the score for the current game. Sets and Matches are out of scope.