GildedRose-Refactoring-Kata/TypeScript/README.md
ahmadalaa67984 51adedafa7 refactor: restructure GildedRose and fix update order
- Added ItemType enum for clearer item categorization
- Split logic into smaller helper methods for readability
- Updated sellIn decrement to occur before quality update
  (matches original Gilded Rose behavior and fixes approval test)
- Improved maintainability, clarity, and type safety
2025-10-15 21:23:42 +03:00

1.5 KiB

Gilded Rose

This is the Gilded Rose kata in TypeScript.

Getting started

Install dependencies

npm install

Run the unit tests from the Command-Line

There are two unit test frameworks to choose from, Jest and Mocha.

npm run test:jest

To run all tests in watch mode

npm run test:jest:watch

Mocha

npm run test:mocha

Run the TextTest fixture from the Command-Line

You may need to install ts-node

npx ts-node test/golden-master-text-test.ts

Or with number of days as args:

npx ts-node test/golden-master-text-test.ts 10

You should make sure the command shown above works when you execute it in a terminal before trying to use TextTest (see below).

Run the TextTest approval test that comes with this project

There are instructions in the TextTest Readme for setting up TextTest. You will need to specify the Python executable and interpreter in config.gr. Uncomment these lines:

executable:${TEXTTEST_HOME}/python/texttest_fixture.py
interpreter:python

//https://github.com/emilybache/GildedRose-Refactoring-Kata.git // https://github.com/emilybache/GildedRose-Refactoring-Kata // GitHub - emilybache/GildedRose-Refactoring-Kata: Starting code for the GildedRose Refactoring Kata in many programming languages. // Starting code for the GildedRose Refactoring Kata in many programming languages. - emilybache/GildedRose-Refactoring-Kata