Skip to content

Commit 78af9cd

Browse files
Add notes to CONTRIBUTING.md about how to use VSCode debugger with tests
1 parent f52749b commit 78af9cd

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,24 @@ where a separate process like `mitmproxy` can intercept outbound requests:
6868
yarn test-mitm --mode integration
6969
```
7070

71+
### Run tests in VSCode "JavaScript Debug Terminal"
72+
73+
If using VSCode, the easiest debugging method is to open a "JavaScript Debug
74+
Terminal" (which you can do via the command palette
75+
"`Debug: JavaScript Debug Terminal`"). Put a `debugger;` statement where you
76+
want to break, and then run vitest in single-threaded mode:
77+
78+
```bash
79+
yarn test --single-thread
80+
```
81+
82+
Or, if you also want to use mitmproxy (assumed to be listening on port `7979`),
83+
then:
84+
85+
```bash
86+
yarn test-mitm --single-thread
87+
```
88+
7189
### Typecheck
7290

7391
We use `tsc` for typechecking, with the default solution file `tsconfig.json`

0 commit comments

Comments
 (0)