mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-11 20:02:09 +00:00
Merge pull request #303 from salpreh/fix/ts-run-app
Fix and document Typescript app run
This commit is contained in:
commit
9d878b7641
@ -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
|
||||
|
||||
@ -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");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user