Skip to content

Commit

Permalink
feat: make skipFiles of launch config configurable via debugExclude s…
Browse files Browse the repository at this point in the history
…etting
  • Loading branch information
geersch committed Jan 25, 2023
1 parent 306eda3 commit 1c07064
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
`[\"**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}\"]`
- `vitest.exclude`: Exclude globs for test files. Default:
`[\"**/node_modules/**\", \"**/dist/**\", \"**/cypress/**\", \"**/.{idea,git,cache,output,temp}/**\"]`
- `vitest.debugExclude`: Automatically skip files covered by these glob patterns. Default:
`[\"<node_internals>/**\", \"**/node_modules/**\"]`

# Screenshots

Expand Down
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@
],
"scope": "resource"
},
"vitest.debugExclude": {
"markdownDescription": "Automatically skip files covered by these glob patterns. \nDefault: `[\"<node_internals>/**\", \"**/node_modules/**\"]`",
"type": "array",
"default": [
"<node_internals>/**",
"**/node_modules/**"
],
"scope": "resource"
},
"vitest.nodeEnv": {
"markdownDescription": "The env passed to runner process in addition to `process.env`",
"type": [
Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export function getConfig(workspaceFolder?: WorkspaceFolder | vscode.Uri | strin
include: get<string[]>('include', []),
exclude: get<string[]>('exclude', []),
enable: get<boolean>('enable', false),
debugExclude: get<string[]>('debugExclude', []),
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/runHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ async function runTest(
request: 'launch',
name: 'Debug Current Test File',
autoAttachChildProcesses: true,
skipFiles: ['<node_internals>/**', '**/node_modules/**'],
skipFiles: config.debugExclude,
program: getVitestPath(workspaceFolder.uri.fsPath),
args,
smartStep: true,
Expand Down

0 comments on commit 1c07064

Please sign in to comment.