chocolatey / chocolatey/ChocoCCM
Ensure we're testing module functions and logic
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 7
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
What You Are Seeing?
Many tests shadow the actual module function with an ad-hoc function that does nothing and only the tests use. As a result, there aren't really any tests for the module logic itself.
What is Expected?
Tests should be verifying the module behaves as intended given various inputs and outputs of mocked functions.
How Did You Get This To Happen? (Steps to Reproduce)
See for example: https://github.com/chocolatey/ChocoCCM/blob/2c92049ff1cbfafe4388cf4bb5105eec3083c808/src/Tests/computer.tests.ps1#L1-L11
System Details
N/A
Output Log
N/A
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/Tests/computer.tests.ps1, especially the example at lines 1-11, and compare its ad-hoc function with the module function it is intended to test. Identify similar tests that shadow module functions; done means those tests exercise the actual module logic with mocked functions and verify its inputs and outputs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- testing
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100