1.5 KiB
1.5 KiB
Testing
Unit tests (default)
pnpm test
Live tests (hits Twitter/X)
Runs the CLI against real Twitter/X GraphQL endpoints to verify read-only commands still work.
Requirements:
TWITTER_RELAY_BASE_URLpointing at a running twitter safe relay- Network access
Run:
pnpm test:livepnpm bird following --all --max-pages 2 --jsonpnpm bird list-timeline <list-id> --all --max-pages 2 --jsonpnpm bird search "from:steipete" --all --max-pages 2 --jsonpnpm bird home --count 5 --jsonpnpm bird home --count 5 --following --json
Notes:
- Live tests are skipped unless
BIRD_LIVE=1(set bypnpm test:live). - Search query is configurable via
BIRD_LIVE_SEARCH_QUERY. - About account handle is configurable via
BIRD_LIVE_ABOUT_HANDLE. - Command timeout is configurable via
BIRD_LIVE_TIMEOUT_MS(ms). - Spawned CLI
NODE_ENVdefaults toproduction(override withBIRD_LIVE_NODE_ENV). - If you don't tweet, set
BIRD_LIVE_TWEET_IDto a known tweet ID to use forread/replies/thread. - Long-form article coverage: set
BIRD_LIVE_LONGFORM_TWEET_IDto a known article tweet ID (example:2007184284944322584from @X; refresh by finding a tweet witharticleviabird user-tweets X -n 20 --json). - Optional: set
BIRD_LIVE_BOOKMARK_FOLDER_IDto exercisebookmarks --folder-id. bird query-ids --freshlive coverage: setBIRD_LIVE_QUERY_IDS_FRESH=1.- The live suite may hit internal X endpoints (v1.1 REST) as fallback through the relay.