Add one-line snippet from failure to provide a context#266
Merged
dlwyatt merged 4 commits intopester:masterfrom Jan 27, 2015
vors:context
Merged
Add one-line snippet from failure to provide a context#266dlwyatt merged 4 commits intopester:masterfrom vors:context
dlwyatt merged 4 commits intopester:masterfrom
vors:context
Conversation
Member
There was a problem hiding this comment.
There's no ConvertTo-Json cmdlet in PowerShell v2.
… not available on PS v2
Member
There was a problem hiding this comment.
This line can go away; nothing else is looking at the ErrorDetails property of ShouldExceptions anymore.
Member
|
I'm going to merge this into master tomorrow afternoon. (It'll make a good demo of our new parallel test execution CI setup during a conference call.) |
Member
|
Just noticed that this is adding output to non-Should exceptions that shouldn't be there. This modification to Get-PesterResult should take care of that: if ($exception.FullyQualifiedErrorID -eq 'PesterAssertionFailed')
{
# we use TargetObject to pass structured information about the error.
$details = $exception.TargetObject
$failureMessage = $details.message
$file = $test.File
$line = $details.line
$lineText = "`n$line`: $($details.linetext)"
}
else {
$failureMessage = $exception.ToString()
$file = $Exception.InvocationInfo.ScriptName
$line = $Exception.InvocationInfo.ScriptLineNumber
$lineText = ''
}
$testResult.failureMessage = $failureMessage -replace "Exception calling", "Assert failed on"
$testResult.stackTrace = "at line: $line in ${file}${lineText}"
return $testResult
} |
dlwyatt
added a commit
that referenced
this pull request
Jan 27, 2015
Add one-line snippet from failure to provide a context
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.
My attempt to implement the behavior described in #265