mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 06:42:03 +00:00
Changes: - Move subprocess-manager tests to @automaker/platform package - Tests need to be co-located with source for proper mocking - Add vitest configuration to platform package - 17/17 platform tests pass - Update server vitest.config.ts to alias @automaker/* packages - Resolve to source files for proper mocking in tests - Enables vi.mock() and vi.spyOn() to work correctly - Fix security.test.ts imports - Update dynamic imports from @/lib/security.js to @automaker/platform - Module was moved to shared package - Rewrite prompt-builder.test.ts - Use fs/promises mock instead of trying to spy on internal calls - 10/10 tests pass Test Results: ✅ Server: 536/536 tests pass ✅ Platform: 17/17 tests pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
45 lines
1.5 KiB
TypeScript
45 lines
1.5 KiB
TypeScript
import { defineConfig } from "vitest/config";
|
|
import path from "path";
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
reporters: ['verbose'],
|
|
globals: true,
|
|
environment: "node",
|
|
setupFiles: ["./tests/setup.ts"],
|
|
coverage: {
|
|
provider: "v8",
|
|
reporter: ["text", "json", "html", "lcov"],
|
|
include: ["src/**/*.ts"],
|
|
exclude: [
|
|
"src/**/*.d.ts",
|
|
"src/index.ts",
|
|
"src/routes/**", // Routes are better tested with integration tests
|
|
],
|
|
thresholds: {
|
|
lines: 65,
|
|
functions: 75,
|
|
branches: 58,
|
|
statements: 65,
|
|
},
|
|
},
|
|
include: ["tests/**/*.test.ts", "tests/**/*.spec.ts"],
|
|
exclude: ["**/node_modules/**", "**/dist/**"],
|
|
mockReset: true,
|
|
restoreMocks: true,
|
|
clearMocks: true,
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
// Resolve shared packages to source files for proper mocking in tests
|
|
"@automaker/utils": path.resolve(__dirname, "../../libs/utils/src/index.ts"),
|
|
"@automaker/platform": path.resolve(__dirname, "../../libs/platform/src/index.ts"),
|
|
"@automaker/types": path.resolve(__dirname, "../../libs/types/src/index.ts"),
|
|
"@automaker/model-resolver": path.resolve(__dirname, "../../libs/model-resolver/src/index.ts"),
|
|
"@automaker/dependency-resolver": path.resolve(__dirname, "../../libs/dependency-resolver/src/index.ts"),
|
|
"@automaker/git-utils": path.resolve(__dirname, "../../libs/git-utils/src/index.ts"),
|
|
},
|
|
},
|
|
});
|