GildedRose-Refactoring-Kata/TypeScript
2023-11-29 12:13:35 +01:00
..
app Add Jest to TypeScript (and update dependencies) 2021-11-09 18:41:26 +01:00
test TS: Add an Approval base test similar to Java-Approvals and CS-xunit-verify using Jest Snapshot. 2023-11-29 12:13:35 +01:00
.editorconfig Add Jest to TypeScript (and update dependencies) 2021-11-09 18:41:26 +01:00
.gitignore Do not commit the lock file. 2023-11-29 12:13:35 +01:00
.mocharc.js Add Jest to TypeScript (and update dependencies) 2021-11-09 18:41:26 +01:00
.nycrc.js Add Jest to TypeScript (and update dependencies) 2021-11-09 18:41:26 +01:00
jest.config.ts Add vitest inside TypeScript 2023-02-22 11:33:47 +01:00
package.json Add vitest inside TypeScript 2023-02-22 11:33:47 +01:00
README.md Get the TypeScript TextTests working more conveniently 2023-11-03 15:26:43 +01:00
texttest_rig.py Get the TypeScript TextTests working more conveniently 2023-11-03 15:26:43 +01:00
tsconfig.json sourceMap must be true for coverage to work with correct line numbers. 2023-11-29 12:13:35 +01:00
vitest.config.ts Add vitest inside TypeScript 2023-02-22 11:33:47 +01:00

Gilded Rose

This is the Gilded Rose kata in TypeScript.

Getting started

Install dependencies

npm install

Run the unit tests from the Command-Line

There are two unit test frameworks to choose from, Jest and Mocha.

npm run test:jest

To run all tests in watch mode

npm run test:jest:watch

Mocha

npm run test:mocha

Run the TextTest fixture from the Command-Line

You may need to install ts-node

npx ts-node test/golden-master-text-test.ts

Or with number of days as args:

npx ts-node test/golden-master-text-test.ts 10

You should make sure the command shown above works when you execute it in a terminal before trying to use TextTest (see below).

Run the TextTest approval test that comes with this project

There are instructions in the TextTest Readme for setting up TextTest. You will need to specify the Python executable and interpreter in config.gr. Uncomment these lines:

executable:${TEXTTEST_HOME}/python/texttest_fixture.py
interpreter:python