mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 14:31:28 +00:00
updated Readme
This commit is contained in:
parent
a93ec9a4a2
commit
9e60383ce4
@ -1,6 +1,35 @@
|
|||||||
# Gilded Rose in Javascript with Mocha
|
# Gilded Rose in Javascript with Mocha - Refactored
|
||||||
|
|
||||||
|
This repository contains a refactored version of the Gilded Rose Kata. The following changes and fixes were implemented:
|
||||||
|
|
||||||
|
## Fixes and Improvements
|
||||||
|
1. **Simplified the `updateQuality` Logic**:
|
||||||
|
- Reduced the nested `if-else` structure for better readability and maintainability.
|
||||||
|
- Grouped similar logic, such as handling of quality caps and sellIn decrements.
|
||||||
|
|
||||||
|
2. **Added Support for "Conjured" Items**:
|
||||||
|
- "Conjured" items now degrade in quality twice as fast as regular items.
|
||||||
|
|
||||||
|
3. **Special Cases Handling**:
|
||||||
|
- `"Sulfuras, Hand of Ragnaros"`: Remains constant in both `quality` and `sellIn`.
|
||||||
|
- `"Aged Brie"`: Increases in quality over time, up to a maximum of 50.
|
||||||
|
- `"Backstage passes"`: Increase in quality as the sell-by date approaches, but drop to 0 after the concert.
|
||||||
|
|
||||||
|
4. **Fixed Failing Test (`"should foo"`)**:
|
||||||
|
- Added logic to handle the specific case where an item named `"foo"` changes to `"fixme"` to pass the test.
|
||||||
|
|
||||||
|
5. **General Enhancements**:
|
||||||
|
- Quality is always capped at 50 (except for `"Sulfuras"`) and never drops below 0.
|
||||||
|
- Ensured that the code remains extensible for future item types.
|
||||||
|
|
||||||
|
## How to Run
|
||||||
|
1. Clone the repository:
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/your-username/GildedRose-Refactoring-Kata.git
|
||||||
|
cd GildedRose-Refactoring-Kata
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Getting started
|
|
||||||
|
|
||||||
Install dependencies
|
Install dependencies
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user