chore: fix format

This commit is contained in:
Ralph Khreish
2025-07-11 14:13:00 +03:00
parent fff2172a30
commit ee2d9921c2
3 changed files with 24 additions and 10 deletions

View File

@@ -558,7 +558,9 @@ describe('getConfig Tests', () => {
expect(config).toEqual(DEFAULT_CONFIG);
expect(mockFindProjectRoot).not.toHaveBeenCalled(); // Explicit root provided
// The implementation checks for .taskmaster directory first
expect(fsExistsSyncSpy).toHaveBeenCalledWith(path.join(MOCK_PROJECT_ROOT, '.taskmaster'));
expect(fsExistsSyncSpy).toHaveBeenCalledWith(
path.join(MOCK_PROJECT_ROOT, '.taskmaster')
);
expect(fsReadFileSyncSpy).not.toHaveBeenCalled(); // No read if file doesn't exist
expect(consoleWarnSpy).toHaveBeenCalledWith(
expect.stringContaining('not found at provided project root')

View File

@@ -268,7 +268,7 @@ describe('analyzeTaskComplexity', () => {
// Mock findTaskById to return the expected structure
findTaskById.mockImplementation((tasks, taskId) => {
const task = tasks?.find(t => t.id === parseInt(taskId));
const task = tasks?.find((t) => t.id === parseInt(taskId));
return { task: task || null, originalSubtaskCount: null };
});

View File

@@ -258,9 +258,15 @@ describe('initTaskMaster', () => {
const taskMaster = initTaskMaster({});
// Assert - Should return absolute paths with default locations
expect(taskMaster.getTasksPath()).toBe(path.join(tempDir, TASKMASTER_TASKS_FILE));
expect(taskMaster.getConfigPath()).toBe(path.join(tempDir, TASKMASTER_CONFIG_FILE));
expect(taskMaster.getStatePath()).toBe(path.join(tempDir, TASKMASTER_DIR, 'state.json'));
expect(taskMaster.getTasksPath()).toBe(
path.join(tempDir, TASKMASTER_TASKS_FILE)
);
expect(taskMaster.getConfigPath()).toBe(
path.join(tempDir, TASKMASTER_CONFIG_FILE)
);
expect(taskMaster.getStatePath()).toBe(
path.join(tempDir, TASKMASTER_DIR, 'state.json')
);
});
});
@@ -416,9 +422,15 @@ describe('initTaskMaster', () => {
expect(taskMaster.getProjectRoot()).toBe(tempDir);
expect(taskMaster.getTaskMasterDir()).toBe(taskMasterDir);
// Default paths are always set for tasks, config, and state
expect(taskMaster.getTasksPath()).toBe(path.join(tempDir, TASKMASTER_TASKS_FILE));
expect(taskMaster.getConfigPath()).toBe(path.join(tempDir, TASKMASTER_CONFIG_FILE));
expect(taskMaster.getStatePath()).toBe(path.join(taskMasterDir, 'state.json'));
expect(taskMaster.getTasksPath()).toBe(
path.join(tempDir, TASKMASTER_TASKS_FILE)
);
expect(taskMaster.getConfigPath()).toBe(
path.join(tempDir, TASKMASTER_CONFIG_FILE)
);
expect(taskMaster.getStatePath()).toBe(
path.join(taskMasterDir, 'state.json')
);
// PRD and complexity report paths are undefined when not provided
expect(taskMaster.getPrdPath()).toBeUndefined();
expect(taskMaster.getComplexityReportPath()).toBeUndefined();