shardeum/shardeum-validator-cli

Implement Unit Tests for Validator-CLI Commands

Open

#31 aperta il 9 ott 2024

Vedi su GitHub
 (6 commenti) (0 reazioni) (0 assegnatari)TypeScript (12 fork)auto 404
good first issuehacktoberfesthelp wanted

Metriche repository

Star
 (51 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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.

Guida contributor