mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-03 21:03:08 +00:00
fix(server): Address PR #733 review feedback and fix cross-platform tests
- Extract merge logic from pipeline-orchestrator to merge-service.ts to avoid HTTP self-call - Make agent-executor error handling provider-agnostic using shared isAuthenticationError utility - Fix cross-platform path handling in tests using path.normalize/path.resolve helpers - Add catch handlers in plan-approval-service tests to prevent unhandled promise rejection warnings Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,9 +9,16 @@
|
||||
*/
|
||||
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
import path from 'path';
|
||||
import { RecoveryService, DEFAULT_EXECUTION_STATE } from '@/services/recovery-service.js';
|
||||
import type { Feature } from '@automaker/types';
|
||||
|
||||
/**
|
||||
* Helper to normalize paths for cross-platform test compatibility.
|
||||
* Uses path.normalize (not path.resolve) to match path.join behavior in production code.
|
||||
*/
|
||||
const normalizePath = (p: string): string => path.normalize(p);
|
||||
|
||||
// Mock dependencies
|
||||
vi.mock('@automaker/utils', () => ({
|
||||
createLogger: () => ({
|
||||
@@ -288,7 +295,7 @@ describe('recovery-service.ts', () => {
|
||||
|
||||
expect(result).toBe(true);
|
||||
expect(secureFs.access).toHaveBeenCalledWith(
|
||||
'/test/project/.automaker/features/feature-1/agent-output.md'
|
||||
normalizePath('/test/project/.automaker/features/feature-1/agent-output.md')
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user