Skip to content

Commit 116078e

Browse files
committed
test: use vite-tsconfig-paths
1 parent d757919 commit 116078e

4 files changed

Lines changed: 40 additions & 6 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164
"reactive-vscode": "catalog:inline",
165165
"tsdown": "catalog:dev",
166166
"typescript": "catalog:dev",
167+
"vite-tsconfig-paths": "catalog:test",
167168
"vitest": "catalog:test",
168169
"vscode-ext-gen": "catalog:dev",
169170
"yaml": "catalog:inline"

pnpm-lock.yaml

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ catalogs:
2121
yaml: ^2.8.2
2222
test:
2323
jest-mock-vscode: ^4.10.0
24+
vite-tsconfig-paths: ^6.1.1
2425
vitest: ^4.0.18

vitest.config.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
import { join } from 'node:path'
22
import { fileURLToPath } from 'node:url'
3+
import tsconfigPaths from 'vite-tsconfig-paths'
34
import { defineConfig } from 'vitest/config'
45

56
const rootDir = fileURLToPath(new URL('.', import.meta.url))
67

78
export default defineConfig({
9+
plugins: [tsconfigPaths()],
810
test: {
911
alias: {
10-
'#constants': join(rootDir, '/src/constants.ts'),
11-
'#state': join(rootDir, '/src/state.ts'),
12-
'#utils': join(rootDir, '/src/utils'),
13-
'#types/*': join(rootDir, '/src/types/*'),
14-
'#utils/*': join(rootDir, '/src/utils/*'),
15-
'vscode': join(rootDir, '/tests/__mocks__/vscode.ts'),
12+
vscode: join(rootDir, '/tests/__mocks__/vscode.ts'),
1613
},
1714
include: ['tests/**/*.test.ts'],
1815
},

0 commit comments

Comments
 (0)