-
-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathvitest.config.ts
More file actions
27 lines (24 loc) · 773 Bytes
/
vitest.config.ts
File metadata and controls
27 lines (24 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { basename, dirname, join } from 'node:path'
import { defineConfig } from 'vitest/config'
const resolveSnapshotPath = (testPath, extension) => {
// only split snapshots for unplugin-vue-i18n tests
if (testPath.includes('unplugin-vue-i18n/test')) {
const framework = '.' + (process.env.TEST_FRAMEWORK || 'vite')
return join(
join(dirname(testPath), '__snapshots__'),
`${basename(testPath)}${framework}${extension}`
)
}
return join(join(dirname(testPath), '__snapshots__'), `${basename(testPath)}${extension}`)
}
export default defineConfig({
resolve: {
alias: {
'@intlify/message-compiler': '@intlify/message-compiler/dist/message-compiler.node.js'
}
},
test: {
globals: true,
resolveSnapshotPath
}
})