Skip to content

Latest commit

Β 

History

History
27 lines (19 loc) Β· 1.63 KB

README.md

File metadata and controls

27 lines (19 loc) Β· 1.63 KB

Kata Template for Test-Commit-Revert (TCR)

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: If you want support for more languages, have a look at joejag/tcr-starters by Joe Wright.

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.

Setup

  1. Checkout this repository (or use this template to create a new one)
  2. Install dependencies with npm i, pnpm i, or yarn install (Husky hooks should be installed)

How to Use

  • Choose a kata; e.g.,
  • Commit often
    • Use Git as you are used to (the pre-commit hook will be executed)
    • Use npm run tcr to commit (it will execute test && commit || revert)
    • Use npm run tcr-timeboxed 5 to continuously test && commit || revert in 5 minute intervalls
      • combine the exercise with npm run tcr or npm run tc (without reset) to commit early
      • cancel with ctrl+c