Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 1 addition & 24 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,30 +174,7 @@ Exceptions:
- `interactive-sigint.test.ts` — needs a longer duration for SIGINT testing
- Help output checks — testing that `--help` mentions `--duration` is fine

**Test structure:**
- `test/unit/` — Fast, mocked tests. Auth via `MockConfigManager` (automatic). Only set `ABLY_API_KEY` env var when testing env var override behavior.
- `test/integration/` — Integration tests (e.g., interactive mode). Mocked external services but tests multi-component interaction.
- `test/tty/` — Interactive mode tests requiring a real pseudo-TTY (e.g., SIGINT/Ctrl+C with readline). Uses `node-pty`. Local only — cannot run in CI.
- `test/e2e/` — Full scenarios against real Ably. Auth via env vars (`ABLY_API_KEY`, `ABLY_ACCESS_TOKEN`).
- Helpers in `test/helpers/` — `runCommand()`, `runLongRunningBackgroundProcess()`, `e2e-test-helper.ts`, `mock-config-manager.ts`.

**Required test describe blocks** (exact names — every unit test file must have all 5):
1. `"help"` — verify `--help` shows USAGE
2. `"argument validation"` — test required args or unknown flag rejection
3. `"functionality"` — core happy-path behavior
4. `"flags"` — verify flags exist and work
5. `"error handling"` — API errors, network failures

Do NOT use variants like `"command arguments and flags"`, `"command flags"`, `"flag options"`, or `"parameter validation"`. Exempt: `interactive.test.ts`, `interactive-sigint.test.ts`, `bench/*.test.ts`.

**Running tests:**
```bash
pnpm test:unit # All unit tests
pnpm test:integration # Integration tests
pnpm test:tty # TTY tests (local only, needs real terminal)
pnpm test:e2e # All E2E tests
pnpm test test/unit/commands/foo.test.ts # Specific test
```
See [`docs/Testing.md`](../docs/Testing.md) for test layers, directory layout, required describe blocks, running tests, helpers reference, and conventions.

## CLI Output & Flag Conventions

Expand Down
Loading
Loading