mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-15 02:25:40 +00:00
Get the TypeScript TextTests working more conveniently
This commit is contained in:
1 parent
3fb6c60ad1
commit
fa5ea72fd2
4 files changed
+49
-21
No files matched your search
+29
-17
@@ -10,23 +10,9 @@ Install dependencies
|
||||
npm install
|
||||
```
|
||||
|
||||
## Running app
|
||||
_You may need to install `ts-node`_
|
||||
## Run the unit tests from the Command-Line
|
||||
|
||||
```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
|
||||
|
||||
### Jest way
|
||||
There are two unit test frameworks to choose from, Jest and Mocha.
|
||||
|
||||
```sh
|
||||
npm run test:jest
|
||||
@@ -38,8 +24,34 @@ To run all tests in watch mode
|
||||
npm run test:jest:watch
|
||||
```
|
||||
|
||||
### Mocha way
|
||||
Mocha
|
||||
|
||||
```sh
|
||||
npm run test:mocha
|
||||
```
|
||||
|
||||
|
||||
## Run the TextTest fixture from the Command-Line
|
||||
|
||||
_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
|
||||
```
|
||||
|
||||
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](../texttests/README.md) for setting up TextTest. You will need to specify the Python executable and interpreter in [config.gr](../texttests/config.gr). Uncomment these lines:
|
||||
|
||||
executable:${TEXTTEST_HOME}/python/texttest_fixture.py
|
||||
interpreter:python
|
||||
|
||||
|
||||
Reference in new issue
Block a user