-
-
Notifications
You must be signed in to change notification settings - Fork 78
Migrate Pester test suite from v4 to v5 #164
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
Open
HeyItsGilbert
wants to merge
22
commits into
master
Choose a base branch
from
pester-v5-migration
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 19 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
cb96e29
test: migrate Pester test suite from v4 to v5
HeyItsGilbert d2e5f74
chore: ✨ update .gitignore and build scripts
HeyItsGilbert cb45438
fix(requirements): 🔧 downgrade PowerShellBuild version to '0.6.1'
HeyItsGilbert bfcc022
chore(ci): ✨ update CI workflow for improved readability
HeyItsGilbert 10d74a0
chore: ✨ update task definitions in `psakeFile.ps1`
HeyItsGilbert 0a3235f
build: upgrade PowerShellBuild to 0.7.3 and skip doc generation
HeyItsGilbert 5f48f22
test: move Set-StrictMode into BeforeAll/AfterAll in strict mode cont…
HeyItsGilbert 25e336c
test: fix Pester 5 BeforeAll scoping in Help.tests.ps1
HeyItsGilbert ed3d67c
test: move Mock calls from It bodies into BeforeAll blocks
HeyItsGilbert 0453cdc
test: move env var cleanup from It body into AfterEach
HeyItsGilbert 40bbf20
test: add Acceptance tag and timeout to help link validation tests
HeyItsGilbert 7acfadc
test: add -Skip:\$nonWindows to Chocolatey Describe block
HeyItsGilbert 680b484
test: resurrect and fix Package Type install tests
HeyItsGilbert 584c4d7
test: add Get-Dependency edge case and filtering tests
HeyItsGilbert a40c4dc
test: add unit tests for Get-PSDependType, Get-PSDependScript, Instal…
HeyItsGilbert e44a77d
fix: resolve Pester v5 migration test failures
HeyItsGilbert bb9051b
fix: resolve remaining Pester v5 migration failures
HeyItsGilbert 652864c
test: fix Package, Npm, and Chocolatey mock failures in Pester v5
HeyItsGilbert e8c1c54
test: use script: scope qualifier on Package stub injection
HeyItsGilbert 23445bb
Address Copilot suggestions + Docs
HeyItsGilbert 638b553
fix(ci): 🐛 correct path for test results upload
HeyItsGilbert 2fcfaa4
fix: 🐛 update URLs to correct organization
HeyItsGilbert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| nuget.exe | ||
| nuget.exe | ||
| Output/** | ||
| Tests/Output/** |
|
HeyItsGilbert marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,18 @@ | ||
| # Idea from http://stackoverflow.com/questions/7468707/deep-copy-a-dictionary-hashtable-in-powershell | ||
| # Idea from http://stackoverflow.com/questions/7468707/deep-copy-a-dictionary-hashtable-in-powershell | ||
| # borrowed from http://stackoverflow.com/questions/8982782/does-anyone-have-a-dependency-graph-and-topological-sorting-code-snippet-for-pow | ||
| function Get-ClonedObject { | ||
| param($DeepCopyObject) | ||
| $memStream = new-object IO.MemoryStream | ||
| $formatter = new-object Runtime.Serialization.Formatters.Binary.BinaryFormatter | ||
| $formatter.Serialize($memStream,$DeepCopyObject) | ||
| $memStream.Position=0 | ||
| $formatter.Deserialize($memStream) | ||
| # BinaryFormatter was removed in .NET 7; use a recursive hashtable clone instead | ||
| $clone = @{} | ||
| foreach ($key in $DeepCopyObject.Keys) { | ||
| $val = $DeepCopyObject[$key] | ||
| if ($val -is [hashtable]) { | ||
| $clone[$key] = Get-ClonedObject $val | ||
| } elseif ($val -is [array]) { | ||
| $clone[$key] = $val.Clone() | ||
| } else { | ||
| $clone[$key] = $val | ||
| } | ||
| } | ||
| $clone | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.