-
Notifications
You must be signed in to change notification settings - Fork 1
test: setup E2E tests #286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…tions and error handling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements a comprehensive end-to-end (E2E) test suite for the CLI tool, reorganizes test files for better maintainability, and enhances the CLI's error handling and argument parsing. The implementation exceeds the original proposal with extensive test coverage including file validation, JSON structure verification, and flag variation testing.
Changes:
- Added E2E test infrastructure with helper utilities supporting dev/production modes and output normalization
- Reorganized integration tests from
test/cli/,test/commands/, andtest/utils/totest/integration/directory structure - Enhanced CLI argument parser to skip required argument validation when help flag is present
- Updated GitHub Actions workflow to run integration and E2E tests as separate steps
Reviewed changes
Copilot reviewed 19 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/helpers/run-cli.ts | New E2E test helper with subprocess spawning, timeout control, and VT control character stripping |
| test/e2e/cli.test.ts | Comprehensive E2E test suite covering all CLI commands, flags, error scenarios, and app name resolution |
| test/integration/**/*.test.ts | Updated import paths to reflect new directory structure (from ../../src/ to ../../../src/) |
| src/cli/parser.ts | Enhanced to skip required argument validation when help flag is present |
| src/cli/runner.ts | Added explicit return statement after error handling for TypeScript control flow analysis |
| package.json | Added test:integration and test:e2e scripts for isolated test execution |
| docs/004-E2E-TEST-IMPLEMENTATION.md | Updated to mark proposal as implemented with detailed completion status and additional test coverage |
| .github/workflows/build-test.yml | Split test step into separate integration and E2E test steps |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This PR implements a comprehensive end-to-end (E2E) test suite for the CLI, enhances the test infrastructure, and reorganizes the test files for better maintainability.
It also improves the CLI argument parser and error handling, and updates the CI workflow to run E2E and integration tests separately.
The documentation has been updated to reflect the completed E2E test implementation, including additional test coverage beyond the original proposal.
E2E Test Implementation and Coverage:
test/helpers/run-cli.ts) that supports both dev and production modes, environment variable injection, timeout control, and output normalization.icons,splash,dotenv), flag variations, error scenarios, and app name resolution, with file and JSON structure validation.docs/004-E2E-TEST-IMPLEMENTATION.md) to mark the proposal as implemented, detail all completed and deferred tasks, and describe the additional test coverage achieved.Test Organization and Scripts:
test/cli/,test/commands/, andtest/utils/totest/integration/andtest/utils/for clearer separation; updated import paths accordingly.test:e2eandtest:integrationscripts topackage.jsonfor running E2E and integration tests independently. The maintestscript now runs both with coverage.Continuous Integration (CI) Workflow:
CLI Parser and Error Handling Improvements: