From 1ecbe74d453f5f856e4bfc7dd9b3097e939610ba Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 1 Nov 2023 14:01:14 +0100 Subject: [PATCH] fix: support typechecking with Yarn PnP (#4412) --- packages/vitest/src/typecheck/parse.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/vitest/src/typecheck/parse.ts b/packages/vitest/src/typecheck/parse.ts index d6337197f446..7c5b5bb70adc 100644 --- a/packages/vitest/src/typecheck/parse.ts +++ b/packages/vitest/src/typecheck/parse.ts @@ -1,4 +1,5 @@ import url from 'node:url' +import os from 'node:os' import { writeFile } from 'node:fs/promises' import { basename, dirname, join, resolve } from 'pathe' import { getTsconfig as getTsconfigContent } from 'get-tsconfig' @@ -77,7 +78,7 @@ export async function getTsconfig(root: string, config: TypecheckConfig) { tmpTsConfig.compilerOptions.emitDeclarationOnly = false tmpTsConfig.compilerOptions.incremental = true tmpTsConfig.compilerOptions.tsBuildInfoFile = join( - __dirname, + process.versions.pnp ? join(os.tmpdir(), 'vitest') : __dirname, 'tsconfig.tmp.tsbuildinfo', )