This repository is a collection of coding katas from
cyber-dojo.org to practice and improve Test-Driven
Development (TDD) skills. Each kata is organized as a separate project within
the ./kata
directory.
-
kata/
Contains subfolders for each kata exercise.. kata ├── 🗂️ _template # Blank kata for setup ├── 🗂️ diamond # Create a pretty alphabet diamond └── 🗂️ yatze # Simple dice game of Yatze
TDD is a development practice where you write tests before writing the code. Each cycle follows three simple steps:
- 🔴 Write a failing test for a new feature or bug fix.
- 🟢 Write the minimum code needed to make the test pass.
- 🟡 Refactor the code for clarity and quality, ensuring all tests still pass.
This cycle is repeated for each new piece of functionality, leading to reliable, well-tested, and maintainable code.
Each kata is a standalone TypeScript project. To set up and run a kata:
-
Navigate to the kata directory
For example, for the Yatzy kata:cd kata/yatze
-
Install dependencies
This project uses bun as the package manager.
If you don't have bun installed, follow the instructions at https://bun.sh/docs/installation.bun install
-
Run tests
Each kata includes tests to verify the implementation.bun test
-
Lint and type-check
To check code style and types:bun run lint bun run typecheck
- Create a new folder under
kata/
(e.g.,kata/new-kata
). - Initialize a new TypeScript project (copy
package.json
,tsconfig.json
, etc. from an existing kata). - Add your implementation and tests in the
src/
directory.