shardeum/shardeum-validator-cli

Implement Unit Tests for Validator-CLI Commands

开放

#31 创建于 2024年10月9日

 (6 条评论) (0 个反应) (0 位负责人)TypeScript (12 个派生)auto 404
good first issuehacktoberfesthelp wanted

仓库指标

星标
 (51 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

The validator-cli contains several important commands in the src/node-commands.ts file, but currently lacks comprehensive unit tests. Adding tests for these commands will significantly improve the reliability and maintainability of the CLI.

Proposed Solution

Implement unit tests for all the commands in the src/node-commands.ts file, covering various scenarios and edge cases.

Expected Outcome

After implementing your solution:

  • All commands in src/node-commands.ts should have corresponding unit tests
  • Test coverage should be high (aim for >80%)
  • Tests should cover successful executions, error handling, and edge cases
  • The codebase will be more reliable and easier to maintain
  • Potential bugs will be caught before reaching production

Getting Started

  • Fork the repository
  • Clone your fork: git clone [your-fork-url]
  • Create a new branch: git checkout -b feature/add-unit-tests
  • Create a new test file: src/tests/node-commands.test.ts
  • Implement unit tests for each command in src/node-commands.ts, including but not limited to: start,stop,status,info,stake,unstake,version,update,gui,clean
  • Run tests and ensure they pass
  • Commit your changes: git commit -m "Add unit tests for operator-cli commands"
  • Push to your fork: git push origin feature/add-unit-tests
  • Create a pull request

Mentorship

If you need any help or have questions about implementing the tests, feel free to ask in the comments. You can also start a discussion here on GitHub, and our team will be happy to provide the necessary assistance.

贡献者指南