-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix: normalize test body invocationDetails from stack traces
#32699
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
base: develop
Are you sure you want to change the base?
Changes from 2 commits
3bb1471
b6bc0f5
926e1fc
49165cf
61311ee
0a8de00
a1480d8
36064a6
65d656c
c0fb620
96a9a10
d0dfb88
5d5cc2d
79c51da
a7e5bb2
7bb0f76
42d6495
1929cba
ec9dad3
85756f0
1bc1d68
4a53ed1
cde2e2c
badf190
d7f64f0
76e2319
31af0fb
dbe8c6f
e9d72cf
4df6616
1dfe50c
6fa202f
50418a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,6 +63,12 @@ const stackWithLinesRemoved = (stack, cb) => { | |
| return unsplitStack(messageLines, remainingStackLines) | ||
| } | ||
|
|
||
| const stackWithGrepLinesRemoved = (stack) => { | ||
| return stackWithLinesRemoved(stack, (lines) => { | ||
| return _.reject(lines, (line) => line.includes('itGrep')) | ||
| }) | ||
| } | ||
astone123 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| const stackWithLinesDroppedFromMarker = (stack, marker, includeLast = false) => { | ||
| return stackWithLinesRemoved(stack, (lines) => { | ||
| // drop lines above the marker | ||
|
|
@@ -149,6 +155,12 @@ const getInvocationDetails = (specWindow, config): InvocationDetails | undefined | |
| } | ||
| } | ||
|
|
||
| // if the stack includes the 'itGrep' function, remove any lines that include it | ||
|
||
| // so that the first line in the stack is the spec invocation | ||
| if (stack.includes('itGrep')) { | ||
| stack = stackWithGrepLinesRemoved(stack) | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Prevent errors from missing Cypress object.Accessing |
||
|
|
||
| const details: Omit<InvocationDetails, 'stack'> = getSourceDetailsForFirstLine(stack, config('projectRoot')) || {}; | ||
|
|
||
| (details as any).stack = stack | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -64,6 +64,32 @@ describe('stack_utils', () => { | |||||
| }) | ||||||
| }) | ||||||
| } | ||||||
|
|
||||||
| it('returns the correct invocation details for a grep stack trace', () => { | ||||||
|
||||||
| it('returns the correct invocation details for a grep stack trace', () => { | |
| it('returns the correct invocation details for a test with a stack that needs to be trimmed', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
Uh oh!
There was an error while loading. Please reload this page.