Commit Graph

15 Commits

Author SHA1 Message Date
Arno Chauveau
15d47f8740 Added new functionality to support conjured items
- add new ConjuredItemsBehavior
- add conjured items behavior detection to resolver
- update snapshots because they didn’t account for conjured items
2025-07-24 16:08:14 +02:00
Arno Chauveau
3fcea88b62 Renamed LegacyBehavior to DefaultBehavior and refactored it's logic 2025-07-24 15:52:53 +02:00
Arno Chauveau
09e9ec6e17 Move Legendary item logic to legendary-item-behavior 2025-07-24 15:39:19 +02:00
Arno Chauveau
6c4e56174c Moved aged-brie-behavior to its own folder, use config.maxQuality 2025-07-24 15:08:37 +02:00
Arno Chauveau
ef9c478e7c Move backstage pass logic to backstage-pass-behavior 2025-07-24 15:08:07 +02:00
Arno Chauveau
cc8a2b35b0 Refactor tests
- moved snapshot tests to better named folder
- refactored gilded-rose tests to unit tests in their right location.
- mock implementation details in gilded rose test
- wrote unit tests for behavior resolver
- fix testing config to account for the changes
2025-07-24 12:56:19 +02:00
Arno Chauveau
372111147f Moved Aged Brie logic to AgedBrieBehavior 2025-07-24 11:50:17 +02:00
Arno Chauveau
1563d86e90 Move logic that maps item names to Update behavior to a new resolver file 2025-07-24 11:49:33 +02:00
Arno Chauveau
f35d2e9c84 Introduce improved file structure, move update logic to legacyBehavior class
- move item to it’s own file.
- Change tsconfig to use ‘@app’ prefix for imports
- move the logic to the legacy-behavior file, allowing to refactor out 
item type by item type
2025-07-24 11:49:26 +02:00
Arno Chauveau
737704e19e Use Array.prototype.map over a for loop
Use Array.prototype.map over a for loop so that we don’t have to use 
array indexing all the time.
2025-07-24 10:17:36 +02:00
Arno Chauveau
6445f7f797 Use strict equality operator over loose equality operator
Use strict equality operator over loose equality operator because it 
is seen as a best practice in the js/ts community.
2025-07-24 10:17:36 +02:00
Arno Chauveau
ba40febb07 Add some comments to code that can't be changed because of requirements 2025-07-24 10:17:36 +02:00
Anthony Rey
b0f4a15245 Add Jest to TypeScript (and update dependencies) 2021-11-09 18:41:26 +01:00
Tomas Novella
939afa9822
Fix compile error in TS
Without a type annotation, TS expects the argument in the ctor to be a never[], hence "npm test" fails to even start
2018-12-09 09:40:49 +01:00
Paulo Clavijo Esteban
10346b66c8 Added GildedRose for TypeScript 2017-06-30 17:32:04 +01:00