Skip to content

CodeItQuick/1RomanNumerals

Repository files navigation

Goals

  1. Introduction to TDD
  2. Follow Red->Green->Refactor
  3. Introduce the minimum amount of code to make the test pass
  4. Implement strong-style pairing with navigator/driver
  5. Introduce ZOMBIES (maybe not needed for this as the test cases are very straight-forward)
  6. Smaller steps
  7. Proper Abstracting/Remove Duplication
  8. 15 minute retrospective at end of session

Description

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

TypeScript Jest boilerplate

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.ts
  • MyJavaScriptModule.test.js
  • MyComponent.test.tsx
  • SubFolder/MyClass.test.ts

You can customize the regexp and jest configuration by editing the package.json file.

Installing dependencies

# Get Yarn
npm install -g yarn

# Install dependencies
yarn install

Running tests

# 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.ts

A 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

About

First Kata in a series - Roman Numerals

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published