/** * Vitest config for Acadenice server specs (R3.x). * * Why a separate vitest config alongside Jest: * The Docmost upstream test suite uses Jest with ts-jest. The Acadenice R3 * server specs were written with vitest (vi.fn(), vi.mock(), etc.) to match * the client-side test style. Rather than rewrite all specs to Jest, we run * acadenice specs with vitest and upstream specs with jest. * * Run: npx vitest run --config vitest.config.ts */ import { defineConfig } from "vitest/config"; import * as path from "path"; export default defineConfig({ resolve: { alias: { "@docmost/db": path.resolve(__dirname, "./src/database"), "@docmost/transactional": path.resolve( __dirname, "./src/integrations/transactional", ), "@docmost/ee": path.resolve(__dirname, "./src/ee"), }, }, test: { // Only cover acadenice specs — upstream Docmost tests use Jest include: ["src/core/acadenice/**/*.spec.ts", "src/database/migrations/**/*.spec.ts"], globals: true, environment: "node", // Vitest needs to transform ESM-only packages server: { deps: { inline: ["nestjs-kysely"], }, }, }, });