Merge pull request #303 from salpreh/fix/ts-run-app

Fix and document Typescript app run
This commit is contained in:
Emily Bache 2022-02-10 13:18:06 +01:00 committed by GitHub
commit 9d878b7641
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 2 deletions

View File

@ -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

View File

@ -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");