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: README.md
+14-2Lines changed: 14 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,11 +72,19 @@ These options are resolved relative to the [workspace file](https://code.visuals
72
72
73
73
-`vitest.rootConfig`: The path to your root config file. If you have several Vitest configs, consider using a [Vitest workspace](https://vitest.dev/guide/workspace).
74
74
-`vitest.workspaceConfig`: The path to the [Vitest workspace](https://vitest.dev/guide/workspace) config file. You can only have a single workspace config per VSCode workspace.
75
-
-`vitest.configSearchPatternExclude`: [Glob pattern](https://code.visualstudio.com/docs/editor/glob-patterns) that should be ignored when this extension looks for config files. Note that this is applied to _config_ files, not test files inside configs. Default: `{**/node_modules/**,**/.*/**,*.d.ts}`If the extension cannot find Vitest, please open an issue.
76
-
-`vitest.nodeExecutable`: This extension spawns another process and will use this value as `execPath` argument.
75
+
-`vitest.configSearchPatternExclude`: [Glob pattern](https://code.visualstudio.com/docs/editor/glob-patterns) that should be ignored when this extension looks for config files. Note that this is applied to _config_ files, not test files inside configs. Default: `{**/node_modules/**,**/.*/**,*.d.ts}`. If the extension cannot find Vitest, please open an issue.
76
+
-`vitest.shellType`: The method the extension uses to spawn a long-running Vitest process. This is particularly useful if you are using a custom shell script to set up the environment. When using the `terminal` shell type, the websocket connection will be established. Can either be `terminal` or `child_process`. Default: `child process`.
77
+
-`vitest.nodeExecutable`: The path to the Node.js executable. If not assigned, tries to find Node.js path via a PATH variable or a `which` command. This is applied only when `vitest.shellType` is `child_process` (the default).
78
+
-`vitest.nodeExecArgs`: The arguments to pass to the Node.js executable. This is applied only when `vitest.shellType` is `child_process` (the default).
79
+
-`vitest.terminalShellPath`: The path to the shell executable. This is applied only when `vitest.shellType` is `terminal`.
80
+
-`vitest.terminalShellArgs`: The arguments to pass to the shell executable. This is applied only when `vitest.shellType` is `terminal`.
77
81
-`vitest.debuggerPort`: Port that the debugger will be attached to. By default uses 9229 or tries to find a free port if it's not available.
78
82
-`vitest.debuggerAddress`: TCP/IP address of process to be debugged. Default: localhost
79
83
84
+
> [!NOTE]
85
+
> The `vitest.nodeExecutable` and `vitest.nodeExecArgs` settings are used as `execPath` and `execArgv` when spawning a new `child_process`, and as `runtimeExecutable` and `runtimeArgs` when [debugging a test](https://github.com/microsoft/vscode-js-debug/blob/main/OPTIONS.md).
86
+
> The `vitest.terminalShellPath` and `vitest.terminalShellArgs` settings are used as `shellPath` and `shellArgs` when creating a new [terminal](https://code.visualstudio.com/api/references/vscode-api#Terminal)
87
+
80
88
### Other Options
81
89
82
90
-`vitest.filesWatcherInclude`: Glob pattern for the watcher that triggers a test rerun or collects changes. Default: `**/*`
@@ -104,3 +112,7 @@ You can change the behaviour of testing view by modifying `testing.openTesting`
104
112
-`openExplorerOnTestStart` will open the test tree view when tests starts
105
113
106
114
This is a vscode's built-in option and will control every plugin.
115
+
116
+
### I am using `vitest.shellType: terminal`, but I don't see it
117
+
118
+
The extension uses a modified Vitest script that removes the reporter output. For this reason, the terminal is hidden by default. However, it might be useful to debug issues with the extension or Vitest itself - to open the terminal in the "Terminals" view you can use the "Vitest: Show Shell Terminal" command.
Copy file name to clipboardExpand all lines: package.json
+31-1Lines changed: 31 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -70,6 +70,11 @@
70
70
"title": "Show Output Channel",
71
71
"command": "vitest.openOutput",
72
72
"category": "Vitest"
73
+
},
74
+
{
75
+
"title": "Show Shell Terminal",
76
+
"command": "vitest.showShellTerminal",
77
+
"category": "Vitest"
73
78
}
74
79
],
75
80
"menus": {
@@ -107,10 +112,15 @@
107
112
"scope": "resource"
108
113
},
109
114
"vitest.nodeExecutable": {
110
-
"description": "The path to the Node.js executable. If not assigned, uses VSCode's Node.js instance.",
115
+
"markdownDescription": "The path to the Node.js executable. If not assigned, tries to find Node.js path via a PATH variable or a `which` command. This is applied only when `vitest.shellType` is `child_process` (the default).",
111
116
"type": "string",
112
117
"scope": "window"
113
118
},
119
+
"vitest.nodeExecArgs": {
120
+
"description": "The arguments to pass to the Node.js executable. This is applied only when `vitest.shellType` is `child_process` (the default).",
121
+
"type": "array",
122
+
"scope": "resource"
123
+
},
114
124
"vitest.workspaceConfig": {
115
125
"markdownDescription": "The path to the Vitest [workspace configuration file](https://vitest.dev/guide/workspace). The extension supports only a single file per VSCode workspace.",
116
126
"type": "string",
@@ -177,6 +187,26 @@
177
187
],
178
188
"default": "info",
179
189
"scope": "resource"
190
+
},
191
+
"vitest.shellType": {
192
+
"markdownDescription": "The method the extension uses to spawn a long-running Vitest process. This is particularly useful if you are using a custom shell script to set up the environment. When using the `terminal` shell type, the websocket connection will be established.",
193
+
"type": "string",
194
+
"enum": [
195
+
"terminal",
196
+
"child_process"
197
+
],
198
+
"default": "child_process",
199
+
"scope": "resource"
200
+
},
201
+
"vitest.terminalShellPath": {
202
+
"markdownDescription": "The path to the shell executable. This is applied only when `vitest.shellType` is `terminal`.",
203
+
"type": "string",
204
+
"scope": "resource"
205
+
},
206
+
"vitest.terminalShellArgs": {
207
+
"markdownDescription": "The arguments to pass to the shell executable. This is applied only when `vitest.shellType` is `terminal`.",
0 commit comments