.agents/skills/testing-clickup-cli/SKILL.md
Run and manage tests for clickup-cli. Covers unit tests, e2e tests against a real ClickUp workspace, and the test data setup. Use when running tests, adding test coverage, debugging test failures, or setting up test fixtures.
npx skillsauth add krodak/clickup-cli testing-clickup-cliInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Suite | Command | Files | What it tests |
| ----- | ------------------ | ------------------------- | ------------------------------------------------------------------ |
| Unit | npm test | tests/unit/**/*.test.ts | All commands, API client, formatters, config. Mocks ClickUpClient. |
| E2E | npm run test:e2e | tests/e2e/**/*.e2e.ts | Real API calls against a live ClickUp workspace. |
Unit tests run in CI. E2E tests require CLICKUP_API_TOKEN in .env.test and are not part of CI.
npm test # all unit tests
npm test -- tests/unit/commands/ # just command tests
npm test -- -t "sprint" # filter by test name
npm run test:e2e # e2e tests (needs .env.test)
The unit test global setup runs npm run build before tests start.
Tests run against the personal ClickUp workspace (profile: personal).
Pre-populated with test fixtures:
| Fixture | What it contains |
| ------------------ | ----------------------------------------------------------------------------- |
| Sprints folder | 3 sprint lists with (M/DD - M/DD) date ranges. Sprint 2 is "current". |
| Backlog list | General tasks for CRUD testing. E2E lifecycle tests create/delete tasks here. |
| Tasks | 11 tasks with varied statuses, priorities, assignees, due dates, tags. |
| Subtasks | 3 subtasks under "Implement user authentication". |
| Checklist | "CI Steps" with 5 items (3 resolved). |
| Tags | backend, frontend, security, design, bug. |
| Comments | 2 comments on the auth task. |
| Dependencies | "Design landing page" depends on "Set up CI pipeline". |
| Overdue task | "Fix login redirect bug" in Sprint 1 with past due date. |
Project tracking space. Not used for tests - used for tracking releases and features.
These create test data, verify operations, and clean up:
| Suite | Tests | Coverage | | -------------- | ----- | ----------------------------------------------------------------------- | | Task lifecycle | 13 | Create, read, update, subtask, comment, checklist, delete, confirm gone | | Tag lifecycle | 4 | Add tag, verify, remove, verify removed | | Time tracking | 5 | Start timer, check running, stop, log entry, list entries |
Each suite uses beforeAll to find the Backlog list and afterAll to clean up created tasks.
Tests API client methods directly: getSpaces, getLists, getTask, sprint detection.
Every command test mocks the API client with vi.mock:
const mockGetTask = vi.fn().mockResolvedValue({ id: 't1', name: 'Task' })
vi.mock('../../../src/api.js', () => ({
ClickUpClient: vi.fn().mockImplementation(function () {
return { getTask: mockGetTask }
}),
}))
The function keyword (not arrow) is required for Vitest 4's new semantics.
Commands export pure functions. Tests import and call them directly:
const { updateTask } = await import('../../../src/commands/update.js')
await updateTask({ apiToken: 'pk_t', teamId: 'team1' }, 't1', { status: 'done' })
expect(mockUpdateTask).toHaveBeenCalledWith('t1', { status: 'done' })
tests/unit/commands/completion.test.ts verifies that:
src/commands/metadata.tsdocs/commands.md quick reference section matches what metadata generatesIf you add a new command, you MUST add it to metadata.ts. If you add new flags, add them too. Then run node --import tsx scripts/sync-command-docs.ts to regenerate the docs.
tests/unit/commands/<name>.test.tsClickUpClient with the methods your command usesnpm test -- tests/unit/commands/<name>.test.tstests/e2e/lifecycle.e2e.ts or create a new *.e2e.ts fileafterAlldescribe.skipIf(!TOKEN) to skip when no API token is setnpm run test:e2e# .env.test (gitignored)
CLICKUP_API_TOKEN=pk_... # personal workspace token
Copy from .env.test.example and fill in your token.
tools
Use when managing ClickUp tasks, sprints, or comments via the `cup` CLI tool. Triggers: task queries, status updates, sprint tracking, creating subtasks, posting comments, threaded replies, standup summaries, searching tasks, checking overdue items, assigning tasks, listing spaces and lists, opening tasks in browser, checking auth or config, setting custom fields, deleting tasks, managing tags, managing checklists, editing comments, task links, time tracking, attachments, file uploads, listing members, listing fields, duplicating tasks, bulk operations, goals, key results, saved filters, favorites.
tools
Use when managing ClickUp tasks, sprints, or comments via the `cup` CLI tool. Triggers: task queries, status updates, sprint tracking, creating subtasks, posting comments, threaded replies, standup summaries, searching tasks, checking overdue items, assigning tasks, listing spaces and lists, opening tasks in browser, checking auth or config, setting custom fields, deleting tasks, managing tags, managing checklists, editing comments, task links, time tracking, attachments, file uploads, listing members, listing fields, duplicating tasks, bulk operations, goals, key results, saved filters, favorites.
tools
Publishes a new version of clickup-cli to npm, updates Homebrew tap, writes release notes, and syncs the agent skill. Use when releasing a new version, bumping version, or verifying a release.
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.