chocolatey / chocolatey/ChocoCCM

Ensure we're testing module functions and logic

Open
#66 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0 - Backlog Bug
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.