X Tutup
The Wayback Machine - https://web.archive.org/web/20200918094933/https://github.com/PowerShell/PSScriptAnalyzer/pull/1182
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

Fix NullReferenceException for class type #1182

Merged

Conversation

@bergmeister
Copy link
Collaborator

bergmeister commented Mar 22, 2019

PR Summary

Fix #1181
Since this bug was already present in 1.17.1, I think we should wait a bit before merging though (as development has not been merged into master yet)

PR Checklist

@bergmeister bergmeister marked this pull request as ready for review Mar 22, 2019
Tests/Engine/InvokeScriptAnalyzer.tests.ps1 Outdated Show resolved Hide resolved
}
'@
It "Does not throw or return diagnostic record" {
Invoke-ScriptAnalyzer -ScriptDefinition $scriptDefinition -ErrorAction Stop | Should -BeNullOrEmpty

This comment has been minimized.

@JamesWTruher

JamesWTruher Mar 22, 2019 Member

i think this should probably be { Invoke-ScriptAnalyzer -ScriptDefinition $scriptDefinition -ErrorAction Stop } | Should -Not Throw

This comment has been minimized.

@bergmeister

bergmeister Mar 22, 2019 Author Collaborator

-ErrorAction Stop already takes care of making the test throw. Jacub who maintains Pester has said that there is no purpose for using Should -Not Throw because Pester will fail the test if the error is terminating (hence the -ErrorAction Stop

…d simplify test case to one-liner
@bergmeister bergmeister merged commit 5485afc into PowerShell:development Apr 15, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla All CLA requirements met.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.
X Tutup