Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vitest): also check for vite relative to vitest package #3274

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/vitest/src/node/pkg.ts
@@ -1,13 +1,16 @@
import url from 'node:url'
import c from 'picocolors'
import { isPackageExists } from 'local-pkg'
import { EXIT_CODE_RESTART } from '../constants'
import { isCI } from '../utils/env'

const __dirname = url.fileURLToPath(new URL('.', import.meta.url))

export async function ensurePackageInstalled(
sheremet-va marked this conversation as resolved.
Show resolved Hide resolved
dependency: string,
root: string,
) {
if (isPackageExists(dependency, { paths: [root] }))
if (isPackageExists(dependency, { paths: [root, __dirname] }))
sheremet-va marked this conversation as resolved.
Show resolved Hide resolved
return true

const promptInstall = !isCI && process.stdout.isTTY
Expand Down