Skip to content

Commit a3393b1

Browse files
JoshuaKGoldbergsheremet-va
andauthoredMay 3, 2023
fix(vitest): also check for vite relative to vitest package (#3274)
Co-authored-by: Vladimir <sleuths.slews0s@icloud.com>
1 parent 44b6a38 commit a3393b1

File tree

1 file changed

+4
-1
lines changed
  • packages/vitest/src/node

1 file changed

+4
-1
lines changed
 

‎packages/vitest/src/node/pkg.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1+
import url from 'node:url'
12
import c from 'picocolors'
23
import { isPackageExists } from 'local-pkg'
34
import { EXIT_CODE_RESTART } from '../constants'
45
import { isCI } from '../utils/env'
56

7+
const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
8+
69
export async function ensurePackageInstalled(
710
dependency: string,
811
root: string,
912
) {
10-
if (isPackageExists(dependency, { paths: [root] }))
13+
if (isPackageExists(dependency, { paths: [root, __dirname] }))
1114
return true
1215

1316
const promptInstall = !isCI && process.stdout.isTTY

0 commit comments

Comments
 (0)
Please sign in to comment.