diff --git a/src/pure/isVitestEnv.ts b/src/pure/isVitestEnv.ts index d76f1e80..14603663 100644 --- a/src/pure/isVitestEnv.ts +++ b/src/pure/isVitestEnv.ts @@ -53,8 +53,8 @@ export async function mayBeVitestEnv(projectRoot: string | WorkspaceFolder): Pro return false const pkgPath = path.join(projectRoot, 'package.json') as string - const pkg = JSON.parse(await readFile(pkgPath, 'utf-8')) as any - if (existsSync(pkg)) { + if (existsSync(pkgPath)) { + const pkg = JSON.parse(await readFile(pkgPath, 'utf-8')) as any if (pkg.devDependencies && pkg.devDependencies.vitest) return true