Fixes #2489 : Fixed issue related to exceptions thrown from the nested spies #2546
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.
Description
Fixed issue related to exceptions thrown from the nested spies.
What changed
Behavior of the filtering redundant method calls from stacktrace was changed.
Now it removes only lines that have the same method name and line number.
I've checked the history of this feature, there were two implementations, each one had some minor defects.
The first one. Let assume that we have the next stacktrace:
This implementation gets difference between current stacktrace and stacktrace from exception, and filters some rows from the beginning. Due to this
mock1:line1
was removed in some casesThe second one worked viceversa, it started filtering from the end of the stacktrace before it find the first iteration of the desired. Let assume that we have the next stacktrace:
This lines will be removed:
In current implementation I'm checking the lines with the same method name and number and remove them from the list, so
from the stack trace provided above only two items will be removed:
I don't have many information about this feature since it contains not so many information, so if I made something wrong, please, give me a clue, how could I fix it :)
Checklist
including project members to get a better picture of the change
commit is meaningful and help the people that will explore a change in 2 years
Fixes #<issue number>
in the description if relevantFixes #<issue number>
if relevant