Give line number when an expectation fails or errors out

Description

When showing that an expectation failed, it would be nice if testbox could walk the stack trace and give the line number of the expectation that failed. I am aware that you can label the expectations and that helps, but sometimes I have multiple of those in a test suite with the same label and something to help jump straight to the failing test would really help.

Activity

Show:
Luis Majano
October 28, 2015, 8:28 PM

In the fail message?

Ryan Guill
October 29, 2015, 1:42 AM

right, anywhere that you put a plus sign button to see the stack trace or the exception. If it could show the line and file (e.g. fooTest.cfc:123) that would be great, itd be easy to copy and then jump right to in your IDE

Luis Majano
January 28, 2016, 3:54 PM

Maybe you can help me, but I have not found a way to figure this one out. Can you help out?

Ryan Guill
January 28, 2016, 5:59 PM

im not sure where the right place to do it would be - id think you probably want to do this any time you populate the `thisSpec.failOrigin`, but looping over that and removing any testbox code from the trace until you get to the actual tests. For example, if I fail an assertion I have to look past assertion.cfc:16, assertion.cfc:183, expectation.cfc:244 and expectation.cfc:90 to get to the test with the actual line number with the assertion that failed. So just removing anything that is /system/*.cfc would probably catch 99% of everything.

then if you could include the actual file and line number with the normal assertion failure message that would be even better.

Luis Majano
February 8, 2016, 11:19 PM

These issues are related, we can now do this.

Fixed

Assignee

Luis Majano

Reporter

Ryan Guill

Labels

None

Components

Fix versions

Affects versions

Priority

Minor
Configure