andy-stack_vaultkeeper-ai/vitest.config.ts
Andrew Beal 4dcce63bce fix: improve mobile UI layout and interaction handling
- Add mobile-specific height constraints for input buttons
- Fix message alignment to left for better readability
- Change click to mousedown for better mobile responsiveness
- Adjust top bar grid columns for mobile layout
- Update view type identifier to 'ai-agent-main-view'
- Standardize quote style to double quotes across config files
2025-11-04 22:51:22 +00:00

79 lines
1.9 KiB
TypeScript

import { defineConfig } from "vitest/config";
import * as path from "path-browserify";
import { fileURLToPath } from "url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig({
plugins: [],
resolve: {
alias: {
"obsidian": path.resolve(__dirname, "__mocks__/obsidian.ts"),
// Support TypeScript path mapping from tsconfig
"Helpers": path.resolve(__dirname, "Helpers"),
"Enums": path.resolve(__dirname, "Enums"),
"Services": path.resolve(__dirname, "Services"),
"Conversations": path.resolve(__dirname, "Conversations"),
"AIClasses": path.resolve(__dirname, "AIClasses"),
"Components": path.resolve(__dirname, "Components"),
"Stores": path.resolve(__dirname, "Stores"),
"Views": path.resolve(__dirname, "Views"),
"Modals": path.resolve(__dirname, "Modals")
}
},
test: {
// Use happy-dom for faster DOM simulation
environment: "happy-dom",
// Test file patterns
include: ["__tests__/**/*.{test,spec}.{js,ts}"],
// Setup files to run before each test file
setupFiles: ["__tests__/setup.ts"],
// Coverage configuration
coverage: {
provider: "v8",
reporter: ["text", "json", "html"],
include: [
"Services/**/*.ts",
"AIClasses/**/*.ts",
"Helpers/**/*.ts",
"Conversations/**/*.ts",
"Components/**/*.svelte",
"Enums/**/*.ts",
"Stores/**/*.ts"
],
exclude: [
"**/*.test.ts",
"**/*.spec.ts",
"node_modules/**",
"__tests__/**",
"main.ts",
"Views/**",
"Modals/**"
],
thresholds: {
lines: 70,
functions: 70,
branches: 65,
statements: 70
}
},
// Global test timeout (10 seconds for most tests)
testTimeout: 10000,
// Enable global test APIs (describe, it, expect, etc.) without imports
globals: true,
// Clear mocks between tests
clearMocks: true,
// Restore mocks between tests
restoreMocks: true,
// Mock reset between tests
mockReset: true
}
});