Skip to content

Commit 996e870

Browse files
chore: allow input to be passed in watch mode (#384)
It's still quite frustrating to use, but it's now possible to do simple stuff (force tests to re-run, for example).
1 parent 0627556 commit 996e870

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,21 @@ BSD-3-Clause © [freeCodeCamp.org](https://freecodecamp.org)
1010
[travis-url]: https://travis-ci.com/freeCodeCamp/curriculum-helpers
1111
[daviddm-image]: https://david-dm.org/freeCodeCamp/curriculum-helpers.svg?theme=shields.io
1212
[daviddm-url]: https://david-dm.org/freeCodeCamp/curriculum-helpers
13+
14+
## Running tests
15+
16+
To run the tests in watch mode, you can use the following command:
17+
18+
```bash
19+
pnpm test:watch
20+
```
21+
22+
This spawns two vitest processes and you can interact with them in the terminal. However, input is passed to the processes in sequence making it tricky to use.
23+
24+
To get a standard vitest interface, you can run the tests separately:
25+
26+
```bash
27+
pnpm test:unit --watch
28+
# or
29+
pnpm test:integration --watch
30+
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
"lint": "eslint . --max-warnings 0 && prettier --check . && tsc --build",
9595
"format": "prettier --write .",
9696
"test": "vitest",
97-
"test:watch": "concurrently --prefix none \"pnpm test:unit --watch\" \"pnpm test:integration --watch\"",
97+
"test:watch": "concurrently -i --raw --prefix none 'pnpm test:unit --watch' --raw 'pnpm test:integration --watch'",
9898
"test:unit": "vitest --config vitest.unit.config.mjs",
9999
"test:integration": "vitest --config vitest.integration.config.mjs",
100100
"prepare": "husky install",

0 commit comments

Comments
 (0)