Skip to content

Update from Pester 4.1.1 to 4.3.1 and use new -BeTrue and -BeFalse operators #906

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

Merged
merged 3 commits into from
Feb 26, 2018

Conversation

bergmeister
Copy link
Collaborator

@bergmeister bergmeister commented Feb 24, 2018

PR Summary

Pester released 2 new versions this week with new assertion operators.

  • Update Pester from version 4.1.1 to 4.3.1
  • Convert calls to Should -Be $true to new operator Should BeTrue and similar for Should BeFalse that were added in 4.2
  • Should -Not -Throw got officially deprecated in 4.2 -> remove assertion because when an exception is thrown, it automatically means that the test should not pass as recommended in the Pester release notes
  • Existing count assertion are not converted to the new -HaveCount operator (yet) because existing tests need adaption (and I also suspect a bug in the new operator I raised the first issue here). This also keeps the diff relatively small.

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets. Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • [NA] User facing documentation needed
  • Change is not breaking
  • [NA] Make sure you've added a new test if existing tests do not effectively test the code changed
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

@@ -118,7 +118,7 @@ Describe "AttributeAst extension methods" {
param($param1, $param2)
}}.Ast.EndBlock.Statements[0]
$extNamespace::IsCmdletBindingAttributeAst($funcDefnAst.Body.ParamBlock.Attributes[0]) |
Should -Be $true
Should BeTrue
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be -BeTrue?

Copy link
Collaborator Author

@bergmeister bergmeister Feb 26, 2018

Choose a reason for hiding this comment

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

Yes! Thanks, I fixed it.

Copy link
Contributor

@JamesWTruher JamesWTruher left a comment

Choose a reason for hiding this comment

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

LGTM

@JamesWTruher
Copy link
Contributor

as soon as ci completes successfully, I'll merge

@JamesWTruher JamesWTruher merged commit bdb8707 into PowerShell:development Feb 26, 2018
@bergmeister
Copy link
Collaborator Author

bergmeister commented Feb 26, 2018

@JamesWTruher On the branch commit and the one that got merged into development, the WMF4 build got cancelled, see here. I assume that was a manual action or is there a problem with the image? I saw that many repos with custom images or ci machines (like e.g. Pester) currently have problems due to the recent breaking change by GitHub that requires the latest update of the Windows Git client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants