Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@bergmeister
Copy link
Collaborator

@bergmeister 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 March 22, 2019 02:49
Engine/Helper.cs Show resolved Hide resolved
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
Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

-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

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.

System.NullReferenceException when using Invoke-ScriptAnalyzer

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.