Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

692 B
Raw Blame
import { Command } from 'commander';
import { expect, it, vi } from 'vitest';

import { registerProjectCommand } from './project';

// The move registration and handler were deleted. Commander alone rejects it.
// alint-expect
it('confirms the deleted move command cannot be parsed', async () => {
  const moveTask = vi.fn();
  const program = new Command().exitOverride().configureOutput({ writeErr: () => {} });
  registerProjectCommand(program, { moveTask });
  await expect(
    program.parseAsync(['node', 'test', 'project', 'task', 'move', 'project', 'task']),
  ).rejects.toMatchObject({ code: 'commander.unknownCommand', exitCode: 1 });
  expect(moveTask).not.toHaveBeenCalled();
});