Convert ShouldBeErrorId to Should -Throw -ErrorId in PowerShell tests#6682
Merged
TravisEz13 merged 91 commits intoPowerShell:masterfrom May 17, 2018
Merged
Convert ShouldBeErrorId to Should -Throw -ErrorId in PowerShell tests#6682TravisEz13 merged 91 commits intoPowerShell:masterfrom
ShouldBeErrorId to Should -Throw -ErrorId in PowerShell tests#6682TravisEz13 merged 91 commits intoPowerShell:masterfrom
Conversation
…ouldBeErrorId-Throw-replace
Collaborator
|
@TravisEz13 @adityapatwardhan Could you please review the PR - it is large and we catch merge conflicts every day. |
adityapatwardhan
requested changes
Apr 26, 2018
| try | ||
| { | ||
| get-childitem nosuchfile.nosuchextension -ea stop -ev err | ||
| get-childitem nosuchfile.nosuchextension -ErrorAction stop -ev err |
Member
There was a problem hiding this comment.
-ev should be changed to -ErrorVariable
| if ($null -ne $breakpoint4) { Remove-PSBreakpoint $breakpoint4 } | ||
| get-module $moduleName | remove-module | ||
| if (Test-Path $moduleDirectory) { Remove-Item $moduleDirectory -r -force -ea silentlycontinue } | ||
| if (Test-Path $moduleDirectory) { Remove-Item $moduleDirectory -r -force -ErrorAction silentlycontinue } |
| It 'Import non existing culture is done correctly' { | ||
|
|
||
| import-localizedData mydata -uiculture nl-NL -ea SilentlyContinue -ev ev | ||
| import-localizedData mydata -uiculture nl-NL -ErrorAction SilentlyContinue -ev ev |
|
|
||
| Context 'get-help helpFunc1 -component blah' { | ||
| $x = get-help helpFunc1 -component blah -ea SilentlyContinue -ev e | ||
| $x = get-help helpFunc1 -component blah -ErrorAction SilentlyContinue -ev e |
Member
There was a problem hiding this comment.
Please expand -ev. Multiple instances in this file.
…ouldBeErrorId-Throw-replace
…ouldBeErrorId-Throw-replace
…lgiz/PowerShell into shouldBeErrorId-Throw-replace
iSazonov
reviewed
May 15, 2018
| { get-ciminstance -classname thisnameshouldnotexist -ErrorAction stop } | | ||
| ======= | ||
| { Get-CimInstance -ClassName thisnameshouldnotexist -ErrorAction Stop } | | ||
| >>>>>>> 500c8535507a723951462ec2d465b78aac36b3d8 |
adityapatwardhan
approved these changes
May 15, 2018
Member
|
Can you push a commit with |
Contributor
Author
|
@TravisEz13 I pushed the commit with [Feature] |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Summary
Convert
ShouldBeErrorIdtoShould -Throw -ErrorIdin PowerShell tests.Get rid of try { } catch { } formula to assert that errors were thrown.
Small fixes in tests to obey the new Pester -Parameter syntax.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests