Files
Spaghet.io/vitest.config.ts
T

28 lines
841 B
TypeScript

// vitest.config.ts
import { defineConfig } from "vitest/config"
import { fileURLToPath } from "node:url"
import solid from "vite-plugin-solid"
// Mirrors the tsconfig path aliases so modules under test can import via @lib/...
const src = fileURLToPath(new URL("./src", import.meta.url))
export default defineConfig({
// Compiles Solid JSX for the island render tests; Astro uses the same plugin for the app.
plugins: [solid({ ssr: true })],
resolve: {
alias: {
"@lib": `${src}/lib`,
"@components": `${src}/components`,
"@layouts": `${src}/layouts`,
"@pages": `${src}/pages`,
"@styles": `${src}/styles`,
"@consts": `${src}/consts.ts`,
"@types": `${src}/types.ts`,
},
},
test: {
environment: "node",
include: ["src/**/__tests__/**/*.test.ts", "src/**/*.test.ts"],
},
})