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.
- Checkout this repository (or
use this template
to create a new one) - Install dependencies with
npm i
,pnpm i
, oryarn install
(Husky hooks should be installed)
- Choose a kata; e.g.,
- from here gamontal/awesome-katas
- or here Kata-log
- or any other that you want to do in TypeScript
- 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