Skip to content

Commit fa5007c

Browse files
committed
04/02: improve the explanation of the launch.json configs
1 parent f7893e6 commit fa5007c

File tree

1 file changed

+4
-4
lines changed
  • exercises/04.debugging/02.problem.debugger

1 file changed

+4
-4
lines changed

exercises/04.debugging/02.problem.debugger/README.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ But worry not, there's a neat way to connect the two!
2929

3030
🐨 Create a new directory `.vscode` and add a new file there called `launch.json` with this content:
3131

32-
```json
32+
```json filename=.vscode/launch.json
3333
{
3434
"version": "0.2.0",
3535
"configurations": [
@@ -65,11 +65,11 @@ This configuration tells Visual Studio Code how to launch your application (in o
6565
- `--inspect-brk`, which tells Node.js to spawn a debugger process. If provided, Vitest will arrange appropriate debugging mode in your browser provider automatically;
6666
- `--browser`, which tells Vitest to run only the browser tests/workspaces;
6767
- `--no-file-parallelism`, which forces Vitest to run our test cases in sequence (required for the debugger to work properly).
68-
- `Attach to Vitest Browser`, which will attach a Chome DevTools instance to the debugging process exposed by Vitest.
68+
- `Attach to Vitest Browser`, which will attach a Chome DevTools instance exposed by the browser tests to the built-in debugger in Visual Studio Code. This will allow you to control the debugging experience directly from your IDE.
6969

70-
Then, we combine these two tasks in a single `compound` task called `Debug Vitest Browser`.
70+
Then, we combine these two tasks to run at the same time under a single `compound` task called `Debug Vitest Browser`.
7171

72-
> 🦉 I am also setting the `env.DEBUG` variable to `'true'` to conditionally run my browser tests in a "headful" mode. That way, I can see what's going on on the page while debugging my tests. Take a look at <InlineFile file="./vite.config.ts">`vite.config.ts`</InlineFile> to see how that variable is referenced.
72+
> 🦉 I am also setting the `env.DEBUG` variable to `'true'` to conditionally run the browser tests in a headless mode mode. That way, I can see what's going on on the page while debugging my tests. Take a look at <InlineFile file="./vite.config.ts">`vite.config.ts`</InlineFile> to see how that environment variable is used.
7373
7474
Once this is done, you can start your browser tests in a debug mode by openning the "Run and debug" window (Shift+Cmd+D) and run the "Debug Vitest Browser" task from the dropdown at the top:
7575

0 commit comments

Comments
 (0)