Variable vscodeExtKitVitestConfigConst
vscodeExtKitVitestConfig: {
resolve: { alias: { vscode: "@kkdev92/vscode-ext-kit/testing/vitest" } };
test: {
server: { deps: { inline: readonly ["@kkdev92/vscode-ext-kit"] } };
};
} = ...
Type Declaration
-
Readonlyresolve: { alias: { vscode: "@kkdev92/vscode-ext-kit/testing/vitest" } }
-
Readonlytest: { server: { deps: { inline: readonly ["@kkdev92/vscode-ext-kit"] } } }
Drop-in Vitest config: aliases
vscodeto the kit's documented partial mock at@kkdev92/vscode-ext-kit/testing/vitestand inlines this kit so the alias reaches it.Why each half is required:
resolve.aliaspoints every Vite-resolvedimport ... from 'vscode'at the mock in@kkdev92/vscode-ext-kit/testing/vitest. This makes the replacement a project configuration rule instead of per-test mock setup, and also covers a built bundle when Vite keeps it in the module graph.server.deps.inlinestops Vitest from externalizing this package. Externalized dependencies load through Node's ESM loader, which knows nothing about Vite aliases — so without this, the kit's ownimport * as vscode from 'vscode'fails withCannot find package 'vscode'even though your test files resolve it fine.This solves module resolution only; it does not turn the partial mock into a real editor. Keep Extension Host tests for behavior outside its documented builders.
Merge order matters only if you also set these keys:
mergeConfigconcatenates arrays and lets the second argument win on scalars, so passing your own config second is the safe default.Plain object rather than a
defineConfigcall, so importing this never drags Vitest's config types into a project that pins a different Vitest major.