cli-e2e-test-authoring

Solid

Guide for adding new end-to-end tests for the Packmind CLI. This skill should be used when creating new test specs in the `apps/cli-e2e-tests/` directory that exercise CLI commands against a real binary and API.

Testing & QA 311 stars 18 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 86/100

Stars 20%
83
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# CLI E2E Test Authoring ## Overview Add end-to-end tests that exercise the Packmind CLI binary (`dist/apps/cli/main.cjs`) in realistic conditions. Tests run the actual CLI as a child process and, when authentication is needed, interact with a running API via HTTP gateways. ## Test File Location All spec files live in `apps/cli-e2e-tests/src/` and follow the naming convention `<command>.spec.ts`. ## Choosing a Test Wrapper Two wrappers are available depending on whether the command requires authentication. ### Unauthenticated commands — `describeWithTempSpace` Provides an isolated temporary directory. No API required. ```typescript import { describeWithTempSpace, runCli } from './helpers'; describeWithTempSpace('my-command without auth', (getContext) => { let result: Awaited<ReturnType<typeof runCli>>; beforeEach(async () => { const { testDir } = await getContext(); result = await runCli('my-command', { cwd: testDir }); }); it('exits with code 1', () => { expect(result.returnCode).toBe(1); }); it('shows an error message', () => { expect(result.stdout).toContain('No credentials found'); }); }); ``` ### Authenticated commands — `describeWithUserSignedUp` Extends `describeWithTempSpace` by creating a real user account, signing in, and generating an API key. Requires a running API at `http://localhost:4200`. ```typescript import { describeWithUserSignedUp, runCli } from './helpers'; describeWithUserSignedUp('my-command with auth', (g...

Details

Author
PackmindHub
Repository
PackmindHub/packmind
Created
1 years ago
Last Updated
today
Language
TypeScript
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category