mirror of
https://github.com/samsonjs/Peekaboo.git
synced 2026-04-26 14:57:47 +00:00
- Add configurable timeout to executeSwiftCli (default 30s) - Add timeout support to execPeekaboo (default 15s) - Support PEEKABOO_CLI_TIMEOUT environment variable - Graceful process termination with SIGTERM then SIGKILL - Skip E2E tests in CI environments and non-macOS platforms - Add test timeouts to vitest config (60s tests, 30s hooks) - Update tool handlers to use appropriate timeouts - Prevent multiple promise resolutions with isResolved flag - Enhanced error messages for timeout scenarios
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import { defineConfig } from "vitest/config";
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
globals: true,
|
|
environment: "node",
|
|
include: [
|
|
"**/tests/unit/**/*.test.ts",
|
|
"**/tests/integration/**/*.test.ts",
|
|
// Only include E2E tests if running on macOS and not in CI
|
|
...(process.platform === "darwin" && !process.env.CI
|
|
? ["peekaboo-cli/tests/e2e/**/*.test.ts"]
|
|
: []
|
|
),
|
|
],
|
|
exclude: [
|
|
"**/node_modules/**",
|
|
"**/dist/**",
|
|
// Exclude E2E tests in CI or non-macOS environments
|
|
...(process.platform !== "darwin" || process.env.CI
|
|
? ["peekaboo-cli/tests/e2e/**/*.test.ts"]
|
|
: []
|
|
),
|
|
],
|
|
// Set reasonable timeouts to prevent hanging
|
|
testTimeout: 60000, // 60 seconds for individual tests
|
|
hookTimeout: 30000, // 30 seconds for setup/teardown hooks
|
|
coverage: {
|
|
provider: "v8",
|
|
reporter: ["text", "lcov", "html"],
|
|
reportsDirectory: "./coverage",
|
|
include: ["src/**/*.ts"],
|
|
exclude: [
|
|
"src/**/*.d.ts",
|
|
"src/index.ts", // Assuming this is the main entry point
|
|
],
|
|
},
|
|
// alias: {
|
|
// '^(\.{1,2}/.*)\.js$': '$1',
|
|
// },
|
|
},
|
|
// resolve: {
|
|
// alias: [
|
|
// { find: /^(\..*)\.js$/, replacement: '$1' },
|
|
// ],
|
|
// },
|
|
});
|