Skip to content

Conversation

@panz3r
Copy link
Member

@panz3r panz3r commented Jan 11, 2026

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:

  • Added a robust E2E test helper (test/helpers/run-cli.ts) that supports both dev and production modes, environment variable injection, timeout control, and output normalization.
  • Implemented comprehensive E2E tests covering core commands (icons, splash, dotenv), flag variations, error scenarios, and app name resolution, with file and JSON structure validation.
  • Updated documentation (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:

  • Moved and renamed integration tests from test/cli/, test/commands/, and test/utils/ to test/integration/ and test/utils/ for clearer separation; updated import paths accordingly.
  • Added test:e2e and test:integration scripts to package.json for running E2E and integration tests independently. The main test script now runs both with coverage.

Continuous Integration (CI) Workflow:

  • Updated the GitHub Actions workflow to run integration and E2E tests as separate steps after the build, improving test granularity and visibility in CI.

CLI Parser and Error Handling Improvements:

  • Modified the CLI argument parser to skip required argument validation if the help flag is present, improving UX for help requests.
  • Improved error handling in the CLI runner to satisfy TypeScript control flow analysis when handling command errors.

@panz3r panz3r added the enhancement New feature or request label Jan 11, 2026
@panz3r panz3r requested a review from Copilot January 11, 2026 19:12
Copy link
Contributor

Copilot AI left a 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/, and test/utils/ to test/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>
@panz3r panz3r enabled auto-merge (squash) January 11, 2026 19:14
@panz3r panz3r merged commit cd07a16 into main Jan 11, 2026
10 checks passed
@panz3r panz3r deleted the setup-e2e-tests branch January 11, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants