- Next.js 16 App Router project with Tailwind CSS - Plant disease knowledge base (93 diseases, 25 plants) - Image upload with client+server preprocessing - ML inference pipeline with mock/demo fallback - Responsive results page with disease cards and treatment - Full test suite (285 passing tests)
32 lines
990 B
TypeScript
32 lines
990 B
TypeScript
import { defineConfig } from "vitest/config";
|
|
import path from "path";
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
globals: true,
|
|
environment: "jsdom",
|
|
include: ["src/**/*.test.ts", "src/**/*.test.tsx"],
|
|
setupFiles: ["src/test/setup.ts"],
|
|
alias: {
|
|
"@/*": path.resolve(__dirname, "./src/*"),
|
|
},
|
|
// Override environment for API integration tests
|
|
testTimeout: 30000,
|
|
// Skip external processing for optional ML dependencies
|
|
server: {
|
|
deps: {
|
|
external: ["@tensorflow/tfjs-node", "onnxruntime-node"],
|
|
},
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
// Mock optional ML backends — model-loader falls back to mock mode
|
|
"@tensorflow/tfjs-node": path.resolve(__dirname, "src/test/mocks/tfjs-node.ts"),
|
|
"@tensorflow/tfjs": path.resolve(__dirname, "src/test/mocks/tfjs.ts"),
|
|
"onnxruntime-node": path.resolve(__dirname, "src/test/mocks/onnxruntime-node.ts"),
|
|
},
|
|
},
|
|
});
|