diff --git a/TypeScript/README.md b/TypeScript/README.md index ec290f53..259e05fe 100644 --- a/TypeScript/README.md +++ b/TypeScript/README.md @@ -10,6 +10,18 @@ Install dependencies npm install ``` +## Running app +_You may need to install `ts-node`_ + +```sh +npx ts-node test/golden-master-text-test.ts +``` + +Or with number of days as args: +```sh +npx ts-node test/golden-master-text-test.ts 10 +``` + ## Running tests To run all tests diff --git a/TypeScript/test/golden-master-text-test.ts b/TypeScript/test/golden-master-text-test.ts index 5984415f..2259b975 100644 --- a/TypeScript/test/golden-master-text-test.ts +++ b/TypeScript/test/golden-master-text-test.ts @@ -1,4 +1,4 @@ -import { Item, GildedRose } from '@/gilded-rose'; +import { Item, GildedRose } from '../app/gilded-rose'; const items = [ new Item("+5 Dexterity Vest", 10, 20), // @@ -14,7 +14,12 @@ const items = [ const gildedRose = new GildedRose(items); -var days: number = 2; + +let days: number = 2; +if (process.argv.length > 2) { + days = +process.argv[2]; + } + for (let i = 0; i < days; i++) { console.log("-------- day " + i + " --------"); console.log("name, sellIn, quality");