Skip to content

Commit 462eda7

Browse files
committed
fix: correctly pass down resolved config files
1 parent 51bbe16 commit 462eda7

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

samples/basic/.vscode/settings.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,7 @@
22
"vitest.nodeEnv": {
33
"TEST_CUSTOM_ENV": "hello"
44
},
5-
"vitest.exclude": [
6-
"**/node_modules/**",
7-
"**/dist/**",
8-
"**/cypress/**",
9-
"**/.{idea,git,cache,output,temp}/**",
10-
"**/ignored.test.ts"
11-
],
125
"[typescript]": {
136
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
14-
},
15-
"vitest.commandLine": "npx vitest"
7+
}
168
}

src/api/pkg.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ export async function resolveVitestPackagesViaConfigs(showWarning: boolean): Pro
193193
}
194194
}
195195

196+
if (rootConfig)
197+
log.info('[API] Using user root config:', rootConfig)
198+
196199
const configs = rootConfig
197200
? [vscode.Uri.file(rootConfig)]
198201
: await vscode.workspace.findFiles(configGlob, config.configSearchPatternExclude)
@@ -218,10 +221,15 @@ export async function resolveVitestPackagesViaConfigs(showWarning: boolean): Pro
218221
: configFiles
219222
filteredConfigFiles.forEach((config) => {
220223
const vitest = resolveVitestConfig(showWarning, config)
221-
if (vitest)
222-
resolvedMeta.push(vitest)
223-
else
224+
if (vitest) {
225+
resolvedMeta.push({
226+
...vitest,
227+
configFile: vitest.id,
228+
})
229+
}
230+
else {
224231
warned = true
232+
}
225233
})
226234
}
227235

0 commit comments

Comments
 (0)