You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: exercises/04.debugging/02.problem.debugger/README.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ But worry not, there's a neat way to connect the two!
29
29
30
30
🐨 Create a new directory `.vscode` and add a new file there called `launch.json` with this content:
31
31
32
-
```json
32
+
```json filename=.vscode/launch.json
33
33
{
34
34
"version": "0.2.0",
35
35
"configurations": [
@@ -65,11 +65,11 @@ This configuration tells Visual Studio Code how to launch your application (in o
65
65
-`--inspect-brk`, which tells Node.js to spawn a debugger process. If provided, Vitest will arrange appropriate debugging mode in your browser provider automatically;
66
66
-`--browser`, which tells Vitest to run only the browser tests/workspaces;
67
67
-`--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.
69
69
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`.
71
71
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 <InlineFilefile="./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 <InlineFilefile="./vite.config.ts">`vite.config.ts`</InlineFile> to see how that environment variable is used.
73
73
74
74
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:
0 commit comments