Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

884 B
Raw Blame
import { afterEach, describe, expect, it } from 'vitest';

import { getLastWorkingDir, setLastWorkingDir } from '../state/lastWorkingDir';

describe('lastWorkingDir', () => {
  afterEach(() => setLastWorkingDir(null));

  it('preserves the active Cindy-managed worktree for cwd-scoped consumers', () => {
    setLastWorkingDir('D:\\projects\\cindy\\.cindy-worktrees\\task-123\\apps\\desktop');
    expect(getLastWorkingDir()).toBe(
      'D:/projects/cindy/.cindy-worktrees/task-123/apps/desktop',
    );

    setLastWorkingDir('/projects/cindy/.xdt-worktrees/task-456/apps/desktop');
    expect(getLastWorkingDir()).toBe('/projects/cindy/.xdt-worktrees/task-456/apps/desktop');
  });

  it('keeps ordinary project directories as the selected project scope', () => {
    setLastWorkingDir('D:\\projects\\cindy\\');
    expect(getLastWorkingDir()).toBe('D:/projects/cindy');
  });
});