- Introduction to TDD
- Follow Red->Green->Refactor
- Introduce the minimum amount of code to make the test pass
- Implement strong-style pairing with navigator/driver
- Introduce ZOMBIES (maybe not needed for this as the test cases are very straight-forward)
- Smaller steps
- Proper Abstracting/Remove Duplication
- 15 minute retrospective at end of session
Direct link to Kata Description: https://kata-log.rocks/roman-numerals-kata
Write a method String convert(int) that takes a number and converts it to the according String representation.
Examples
1 ➔ I
2 ➔ II
3 ➔ III
4 ➔ IV
5 ➔ V
6 ➔ VI
7 ➔ VII
8 ➔ VIII
9 ➔ IX
10 ➔ X
11 ➔ XI
12 ➔ XII
13 ➔ XIII
14 ➔ XIV
15 ➔ XV
16 ➔ XVI
17 ➔ XVII
18 ➔ XVIII
19 ➔ XIX
20 ➔ XX
21 ➔ XXI
50 ➔ L
100 ➔ C
500 ➔ D
1000 ➔ M
This boilerplate uses TypeScript and Jest as testing framework. Test files should are picked based on their name, here's a few examples that will get picked up by Jest:
MyClass.test.tsMyJavaScriptModule.test.jsMyComponent.test.tsxSubFolder/MyClass.test.ts
You can customize the regexp and jest configuration by editing the package.json file.
# Get Yarn
npm install -g yarn
# Install dependencies
yarn install# Run tests once
yarn test
# Run tests with Jest-CLI custom arguments (https://jestjs.io/docs/en/cli.html)
yarn test --clearCache --debug
# Run tests for a specific file
yarn test MyFile.test.tsA few other NPM scripts are provided for convenience, they all support custom arguments as described above.
# Run tests once with coverage
# Coverage report available in ./coverage/index.html
yarn test:cover
# Run all tests in watch mode without coverage
yarn test:watch
# Run the tests with watch mode only for files changed since the last Git commit
yarn test:changed
# Run tests for CI environment (optimized for TravisCI)
yarn test:ci