Skip to content

Commit

Permalink
fix: read package.json to check if a folder is a Vitest env
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienbaron committed Dec 30, 2022
1 parent b4ebe9c commit df13127
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pure/isVitestEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit df13127

Please sign in to comment.