Skip to content

Add Assert assertions to Pester - #2428

Merged
nohwnd merged 63 commits into
mainfrom
add-assert
May 21, 2024
Merged

nohwnd merged 63 commits into
mainfrom
add-assert

Conversation

@nohwnd

@nohwnd nohwnd commented Apr 2, 2024 •

Copy link
Copy Markdown
Member

Fix #1423
Fix #1316
Fix #1323
Fix #1355

PR Summary

This PR adds assertions from Assert module to Pester, to serve as a base for future assertions and to live side-by-side with the existing Should assertions that are based on parameter sets.

PR Checklist

  • PR has meaningful title
  • Summary describes changes
  • PR is ready to be merged
    • If not, use the arrow next to Create Pull Request to mark it as a draft. PR can be marked Ready for review when it's ready.
  • Tests are added/update (if required)
  • Documentation is updated/added (if required)

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

PSScriptAnalyzer found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@fflaten

fflaten commented Apr 2, 2024 •

Copy link
Copy Markdown
Contributor

We should probably decide on #2381 soon, so these assertions can either implement it - or not. 🙂

@nohwnd
nohwnd changed the base branch from main to dev/6.x.x April 10, 2024 19:15
@nohwnd

nohwnd commented Apr 21, 2024

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@nohwnd
nohwnd marked this pull request as ready for review May 18, 2024 13:06
@nohwnd

nohwnd commented May 18, 2024

Copy link
Copy Markdown
Member Author

Should be good enough to release in 6.0.0-alpha1 so we can get other people to look at this. Please give at another quick review @fflaten .

@fflaten

fflaten commented May 18, 2024

Copy link
Copy Markdown
Contributor

With 7k linediff I can't promise "quick", but I'll try tomorrow when my browser is done rendering the diff. 🙂 I'll trust your tests for functionality.

@fflaten fflaten left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great work! 🚀 I left some comments, some of which should be addressed before alpha.

I haven't tested these manually and only skimmed through the tests for now. Wouldn't be able to find missing testcases on such a large PR tbh. and it looks like you've covered the basics.

Comment thread src/Module.ps1 Resolved
Comment thread tst/Help.Tests.ps1 Resolved
Comment thread src/Format2.ps1 Resolved
Comment thread src/Format2.ps1 Resolved
@nohwnd

nohwnd commented May 20, 2024

Copy link
Copy Markdown
Member Author

I've fixed all the suggestions, and what I did not fix I moved to issues :) Pls approve.

@nohwnd
nohwnd merged commit b577d1b into main May 21, 2024
@nohwnd
nohwnd deleted the add-assert branch May 21, 2024 06:59
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.

Way forward for Should? Issue with -Be assertion operator after adding custom Improve Should -BeLike for arrays Improve BeTrue assertion

3 participants