Files
sf-sim/vitest.config.ts

38 lines
781 B
TypeScript
Raw Permalink Normal View History

2026-01-27 10:00:51 +01:00
import { defineConfig } from 'vitest/config'
import tsconfigPaths from 'vite-tsconfig-paths'
import fs from 'node:fs'
import path from 'node:path'
const packagesDir = path.resolve(__dirname, 'packages')
const projects = [path.resolve(__dirname, 'tsconfig.json')]
if (fs.existsSync(packagesDir)) {
const packages = fs.readdirSync(packagesDir)
for (const pkg of packages) {
const tsconfigPath = path.join(packagesDir, pkg, 'tsconfig.json')
if (fs.existsSync(tsconfigPath)) {
projects.push(tsconfigPath)
}
}
}
export default defineConfig({
test: {
projects: [
'./packages/*',
{
extends: true,
envDir: "./"
}
]
},
plugins: [
tsconfigPaths({
root: "./",
projects
})
],
resolve: {
}
})