mirror of
https://github.com/eyaltoledano/claude-task-master.git
synced 2026-01-30 06:12:05 +00:00
chore: apply requested changes
This commit is contained in:
@@ -18,6 +18,9 @@ import {
|
||||
} from '../../fixtures/task-fixtures';
|
||||
import { getCliBinPath } from '../../helpers/test-utils';
|
||||
|
||||
// Capture initial working directory at module load time
|
||||
const initialCwd = process.cwd();
|
||||
|
||||
describe('list command', () => {
|
||||
let testDir: string;
|
||||
let tasksPath: string;
|
||||
@@ -44,9 +47,10 @@ describe('list command', () => {
|
||||
|
||||
afterEach(() => {
|
||||
try {
|
||||
const originalDir = path.resolve(__dirname, '../../../../..');
|
||||
process.chdir(originalDir);
|
||||
// Restore to the original working directory captured at module load
|
||||
process.chdir(initialCwd);
|
||||
} catch {
|
||||
// Fallback to home directory if initial directory no longer exists
|
||||
process.chdir(os.homedir());
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,9 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
||||
import { createTask, createTasksFile } from '../../fixtures/task-fixtures';
|
||||
import { getCliBinPath } from '../../helpers/test-utils';
|
||||
|
||||
// Capture initial working directory at module load time
|
||||
const initialCwd = process.cwd();
|
||||
|
||||
describe('next command', () => {
|
||||
let testDir: string;
|
||||
let tasksPath: string;
|
||||
@@ -40,9 +43,10 @@ describe('next command', () => {
|
||||
|
||||
afterEach(() => {
|
||||
try {
|
||||
const originalDir = path.resolve(__dirname, '../../../../..');
|
||||
process.chdir(originalDir);
|
||||
// Restore to the original working directory captured at module load
|
||||
process.chdir(initialCwd);
|
||||
} catch {
|
||||
// Fallback to home directory if initial directory no longer exists
|
||||
process.chdir(os.homedir());
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
||||
import { createTask, createTasksFile } from '../../fixtures/task-fixtures';
|
||||
import { getCliBinPath } from '../../helpers/test-utils';
|
||||
|
||||
// Capture initial working directory at module load time
|
||||
const initialCwd = process.cwd();
|
||||
|
||||
describe('set-status command', () => {
|
||||
let testDir: string;
|
||||
let tasksPath: string;
|
||||
@@ -41,9 +44,10 @@ describe('set-status command', () => {
|
||||
|
||||
afterEach(() => {
|
||||
try {
|
||||
const originalDir = path.resolve(__dirname, '../../../../..');
|
||||
process.chdir(originalDir);
|
||||
// Restore to the original working directory captured at module load
|
||||
process.chdir(initialCwd);
|
||||
} catch {
|
||||
// Fallback to home directory if initial directory no longer exists
|
||||
process.chdir(os.homedir());
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@ import {
|
||||
} from '../../fixtures/task-fixtures';
|
||||
import { getCliBinPath } from '../../helpers/test-utils';
|
||||
|
||||
// Capture initial working directory at module load time
|
||||
const initialCwd = process.cwd();
|
||||
|
||||
describe('show command', () => {
|
||||
let testDir: string;
|
||||
let tasksPath: string;
|
||||
@@ -44,9 +47,10 @@ describe('show command', () => {
|
||||
|
||||
afterEach(() => {
|
||||
try {
|
||||
const originalDir = path.resolve(__dirname, '../../../../..');
|
||||
process.chdir(originalDir);
|
||||
// Restore to the original working directory captured at module load
|
||||
process.chdir(initialCwd);
|
||||
} catch {
|
||||
// Fallback to home directory if initial directory no longer exists
|
||||
process.chdir(os.homedir());
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,9 @@ import path from 'node:path';
|
||||
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
||||
import { getCliBinPath } from '../helpers/test-utils';
|
||||
|
||||
// Capture initial working directory at module load time
|
||||
const initialCwd = process.cwd();
|
||||
|
||||
describe('Task Lifecycle Integration Tests', () => {
|
||||
let testDir: string;
|
||||
let tasksPath: string;
|
||||
@@ -83,11 +86,10 @@ describe('Task Lifecycle Integration Tests', () => {
|
||||
*/
|
||||
afterEach(() => {
|
||||
try {
|
||||
// Change to a safe directory before cleanup
|
||||
const originalDir = path.resolve(__dirname, '../../../..');
|
||||
process.chdir(originalDir);
|
||||
// Restore to the original working directory captured at module load
|
||||
process.chdir(initialCwd);
|
||||
} catch (error) {
|
||||
// Fallback to home directory if project root unavailable
|
||||
// Fallback to home directory if initial directory no longer exists
|
||||
process.chdir(os.homedir());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user