-
Notifications
You must be signed in to change notification settings - Fork 1
test: migrate test setup from Mocha/Chai to NodeJS built-in #285
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
…ai assertions with `node:assert`, and refine test file imports
…oving unnecessary `ts-node` configuration
…e and remove Mocha references
… test runner transition
…ovements and recommendations
… from Mocha to Node.js test patterns
…rt in code review documents
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 migrates the test infrastructure from Mocha/Chai to Node.js's built-in node:test module with node:assert/strict assertions and tsx for TypeScript support. The migration updates all test files, configuration files, and documentation to use modern Node.js testing features while maintaining zero external testing dependencies.
Changes:
- Replaced Mocha/Chai imports with
node:testandnode:assert/strictacross all test files - Removed
.mocharc.jsonand Mocha/Chai dependencies frompackage.json - Updated VSCode debug configurations and documentation to reference the new test runner
Reviewed changes
Copilot reviewed 21 out of 25 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/utils/file-utils.test.ts | Migrated assertions from Chai to node:assert/strict |
| test/utils/color.utils.test.ts | Updated to use Node.js test runner and assertions |
| test/utils/app.utils.test.ts | Converted Chai expectations to strict assertions |
| test/commands/splash.test.ts | Added concurrency control and updated test patterns |
| test/commands/icons.test.ts | Migrated to node:test with timeout configuration |
| test/commands/dotenv.test.ts | Updated assertions and added new test cases |
| test/commands/base.test.ts | New test file for BaseCommand functionality |
| test/cli/runner.test.ts | New test file for CLI runner functionality |
| test/cli/parser.test.ts | New test file for argument parser |
| test/cli/output.test.ts | New test file for output utilities |
| test/cli/help.test.ts | New test file for help text generation |
| test/cli/errors.test.ts | New test file for error handling |
| package.json | Updated test script and dependencies |
| docs/005-CODE-REVIEW-IMPROVEMENTS.md | New comprehensive code review document |
| docs/004-E2E-TEST-IMPLEMENTATION.md | Updated examples to use new test framework |
| docs/002-MIGRATION-TEST-RUNNER.md | Marked migration as completed with all steps checked |
| AGENTS.md | Updated testing instructions for new framework |
| .vscode/launch.json | Replaced ts-node with tsx in debug configs |
| .mocharc.json | Removed Mocha configuration file |
| .github/copilot-instructions.md | Updated test runner references |
| .github/agents/test-developer.agent.md | Updated test patterns and examples |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
…file Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This PR completes the migration of the project's test runner from Mocha/Chai to Node.js's built-in
node:testmodule, usingnode:assert/strictfor assertions andtsxfor TypeScript support.It updates all documentation, configuration, and test patterns to reflect the new setup, removes Mocha-related dependencies and configuration files, and ensures that all test files and helper scripts are compatible with the new test runner.
The migration improves maintainability and leverages modern Node.js features for testing.
Test runner migration and configuration updates:
node:testandnode:assert/strictfor writing and running tests, with TypeScript support provided bytsx. Mocha/Chai imports and patterns have been replaced throughout the codebase..mocharc.jsonconfiguration file and all Mocha/Chai-related dependencies have been removed from the project.package.json, documentation, and helper files have been updated to use the new test runner and assertion patterns.Documentation and agent updates:
AGENTS.md,.github/copilot-instructions.md, migration docs) have been updated to reference the Node.js test runner and new assertion patterns, including detailed migration steps and code examples..github/agents/test-developer.agent.mdfile now describes the new test framework and assertion patterns, with updated code samples and instructions.Development tooling updates:
.vscode/launch.json) has been updated to usetsxinstead ofts-nodefor TypeScript execution in development and debugging.Migration documentation:
docs/002-MIGRATION-TEST-RUNNER.mdhas been marked as completed, with all steps checked off and new patterns/examples added for reference.