mirror of
https://github.com/hanzoai/vitest.git
synced 2026-09-24 17:04:25 +00:00
18 lines
393 B
JavaScript
18 lines
393 B
JavaScript
import { defineConfig } from 'vitest/config'
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
{
|
|
name: 'test:replacer',
|
|
transform(code) {
|
|
return code.replace('__REPLACED__', JSON.stringify(process.env.REPLACED))
|
|
},
|
|
configureVitest(ctx) {
|
|
ctx.defineCacheKeyGenerator(() => {
|
|
return String(process.env.REPLACED)
|
|
})
|
|
},
|
|
},
|
|
],
|
|
})
|