Skip to content

Commit dda4400

Browse files
committed
Apply automated code formatting fixes to vitest config
1 parent 4532b75 commit dda4400

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

vitest.config.mts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@ import path from 'node:path'
22

33
import { defineConfig } from 'vitest/config'
44

5+
const isCoverage = process.argv.includes('--coverage')
6+
57
export default defineConfig({
68
resolve: {
7-
alias: {
8-
'../dist/index': path.resolve(__dirname, './src/index.ts'),
9-
'../dist/http-client.js': path.resolve(__dirname, './src/http-client.ts'),
10-
},
9+
// Map dist imports to src when running coverage, use dist otherwise.
10+
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+
: {},
1119
},
1220
test: {
1321
globals: false,

0 commit comments

Comments
 (0)