Skip to content
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

Add support for Assert-MockCalled #37

Merged
merged 11 commits into from
Feb 16, 2025
Merged

Add support for Assert-MockCalled #37

merged 11 commits into from
Feb 16, 2025

Conversation

johlju
Copy link
Member

@johlju johlju commented Feb 16, 2025

Pull Request (PR) description

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (if applicable).
  • Documentation added/updated in README.md and source/WikiSource.
  • Comment-based help added/updated for all new/changed functions.
  • Localization strings added/updated in all localization files as appropriate.
  • Examples appropriately added/updated.
  • Unit tests added/updated. See DSC Community Testing Guidelines.
  • Integration tests added/updated (where applicable). See
    DSC Community Testing Guidelines.
  • New/changed code adheres to DSC Community Style Guidelines.

This change is Reviewable

@johlju johlju requested a review from a team as a code owner February 16, 2025 12:17
Position 1: CommandName
Position 2: Times
#>
function Convert-AssertMockCalled

Check warning

Code scanning / PSScriptAnalyzer

Unable to determine parameter set used by example 1 for the function Convert-AssertMockCalled Warning

Unable to determine parameter set used by example 1 for the function Convert-AssertMockCalled
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link

codecov bot commented Feb 16, 2025

Codecov Report

Attention: Patch coverage is 97.72727% with 3 lines in your changes missing coverage. Please review.

Project coverage is 99%. Comparing base (24948be) to head (f5a436c).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
source/Public/Convert-PesterSyntax.ps1 96% 2 Missing ⚠️
source/Private/Get-CommandName.ps1 75% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@         Coverage Diff         @@
##           main    #37   +/-   ##
===================================
- Coverage    99%    99%   -1%     
===================================
  Files        31     33    +2     
  Lines      1252   1341   +89     
===================================
+ Hits       1249   1337   +88     
- Misses        3      4    +1     
Flag Coverage Δ
unit 99% <97%> (-1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
source/Private/Convert-AssertMockCalled.ps1 100% <100%> (ø)
source/Private/Convert-ShouldHaveCount.ps1 100% <100%> (ø)
source/Private/ConvertTo-ActualParameterName.ps1 100% <100%> (ø)
source/Private/Get-PesterCommandSyntaxVersion.ps1 100% <100%> (ø)
source/Private/Get-ShouldCommandOperatorName.ps1 100% <ø> (ø)
source/Private/Get-CommandName.ps1 75% <75%> (ø)
source/Public/Convert-PesterSyntax.ps1 97% <96%> (+<1%) ⬆️

Copy link
Member Author

@johlju johlju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 11 of 14 files at r1, 1 of 1 files at r2, 9 of 9 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @Github-advanced-security[bot])


source/Private/Convert-AssertMockCalled.ps1 line 3 at r3 (raw file):

<#
    .SYNOPSIS
        Converts a command `Assert-MockCalled` to `Should -Invoke`.

Suggestion:

Converts a command `Assert-MockCalled` to `Should -Invoke` or `Should-Invoke`.

Position 1: CommandName
Position 2: Times
#>
function Convert-AssertMockCalled
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member Author

@johlju johlju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Github-advanced-security[bot])

@johlju johlju merged commit 74731a7 into main Feb 16, 2025
15 of 16 checks passed
@johlju johlju deleted the ghcw-session-1c13 branch February 16, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert Assert-MockCalled to Should -Invoke
1 participant