-
-
Notifications
You must be signed in to change notification settings - Fork 467
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
$pester.ShouldExceptionLine on occasion doesn't exist #75
Comments
Add: '''' Describe "Test Set-StrictMode" {
}
Property 'testResult' cannot be found on this object. Make sure that it exists.
Property 'testResult' cannot be found on this object. Make sure that it exists.
Tests completed in 0ms |
PowerShell 2.0 and 3.0 compatibility is sort of in an unknown state right now :-( I'm currently getting a Windows VM sorted out so I can take a look at this. Thanks for the sample code and output, that'll help in figuring this out. |
I'm also having this problem with Set-StrictMode.
I get the following output:
PowerShell version is 4.0, Pester version is 2.0.4 (March 9, 2014) |
Caveat: I can't imagine this hasn't been found by others so I suspect I am doing something wrong, however, there seems to be a problem (given my usage) with It.ps1.
If I throw an error in my test (mistakenly or intentionally), it appears that Get-PesterResult fails with the following errors:
I believe the problem is that on occasion (perhaps never?), ShouldExceptionLine is not set. To avoid this I changed the conditional in the if statement from simply
to
I suspect an additional modification would be to set ShouldExceptionLine (possibly in the catch block on line 76 of It.ps1, but I am not certain) as follows:
I wonder if the problem is due to a Set-StrictMode -Version "Latest" or Set-StrictMode -Version 3 entry, perhaps that is why others haven't noticed this?
Thanks,
Mark
The text was updated successfully, but these errors were encountered: