We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4532b75 commit dda4400Copy full SHA for dda4400
vitest.config.mts
@@ -2,12 +2,20 @@ import path from 'node:path'
2
3
import { defineConfig } from 'vitest/config'
4
5
+const isCoverage = process.argv.includes('--coverage')
6
+
7
export default defineConfig({
8
resolve: {
- alias: {
- '../dist/index': path.resolve(__dirname, './src/index.ts'),
9
- '../dist/http-client.js': path.resolve(__dirname, './src/http-client.ts'),
10
- },
+ // Map dist imports to src when running coverage, use dist otherwise.
+ alias: isCoverage
11
+ ? {
12
+ '../dist/index': path.resolve(__dirname, './src/index.ts'),
13
+ '../dist/http-client.js': path.resolve(
14
+ __dirname,
15
+ './src/http-client.ts',
16
+ ),
17
+ }
18
+ : {},
19
},
20
test: {
21
globals: false,
0 commit comments