ralph/chore/fix.tests (#1578)

This commit is contained in:
Ralph Khreish
2026-01-15 15:46:15 +01:00
committed by GitHub
parent d4680f446d
commit 87ba3a2a5b
14 changed files with 162 additions and 147 deletions

View File

@@ -16,8 +16,8 @@
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"test:unit": "vitest run -t unit",
"test:integration": "vitest run -t integration",
"test:unit": "vitest run '**/*.spec.ts'",
"test:integration": "vitest run '**/*.test.ts'",
"test:e2e": "vitest run --dir tests/e2e",
"test:ci": "vitest run --coverage --reporter=dot"
},

View File

@@ -77,8 +77,8 @@ describe('LoopCommand', () => {
mockTmCore = {
loop: {
run: mockLoopRun,
checkSandboxAuth: vi.fn().mockReturnValue(true),
runInteractiveAuth: vi.fn(),
checkSandboxAuth: vi.fn().mockReturnValue({ ready: true }),
runInteractiveAuth: vi.fn().mockReturnValue({ success: true }),
resolveIterations: vi.fn().mockImplementation((opts) => {
// Mirror the real implementation logic for accurate testing
if (opts.userIterations !== undefined) return opts.userIterations;
@@ -400,7 +400,7 @@ describe('LoopCommand', () => {
});
it('should run interactive auth when sandbox not ready', async () => {
mockTmCore.loop.checkSandboxAuth.mockReturnValue(false);
mockTmCore.loop.checkSandboxAuth.mockReturnValue({ ready: false });
const result = createMockResult();
mockLoopRun.mockResolvedValue(result);

View File

@@ -17,8 +17,8 @@
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"test:unit": "vitest run -t unit",
"test:integration": "vitest run -t integration",
"test:unit": "vitest run '**/*.spec.ts'",
"test:integration": "vitest run '**/*.test.ts'",
"test:ci": "vitest run --coverage --reporter=dot"
},
"dependencies": {

View File

@@ -158,7 +158,7 @@ describe('generate MCP tool', () => {
const response = callMCPTool('generate', { projectRoot: testDir });
expect(response.data.orphanedFilesRemoved).toBe(1);
}, 15000);
}, 30000); // Longer timeout: this test makes 2 MCP calls (generate, then regenerate)
it('should accept output parameter for custom directory', () => {
const testData = createTasksFile({