You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Proposal
Capture the line number when test is invoked and either add it to the stack trace or add it above the diff, e.g. typescript/spec/something.spec.ts:7
Notes
Interestingly, the report is a bit different when the macro is inside vs outside the spec file. This can be seen on the root commit in the reproduction repository. Example diff with the + side representing a macro outside the spec file:
Number must be 5
-typescript/spec/something.spec.ts:4-3: const macro: Macro<[number]> = (t, number) => {-4: t.is(number, 5); -5: }
Difference:
﹣ 4
﹢ 5
-› macro (typescript/spec/something.spec.ts:4:7)+› macro (typescript/helper/macro.ts:4:7)
The text was updated successfully, but these errors were encountered:
novemberborn
changed the title
Report does not contain a reference to the location of the test when using macros
Report does not contain a reference to the location of the test when using macros or helpers from another file
Mar 21, 2021
I believe this is a known issue, or at least I'm not surprised by it, but I can't immediately find an existing issue for this either.
I believe we try to find the line where the assertion was called. But that must be within the test file. It would be interesting to find the first line from the test file and provide context for that.
I'll have a look and see if I can add the filename and line number of the test to the stack trace. In which file would you like me to add tests regarding this?
In which file would you like me to add tests regarding this?
The laziest answer would be the reporter tests, but they're not easy to maintain.
The harder answer is a new self-hosted test in test/, using internal access to the raw result data. But you'll have to do some digging around for that (or leave it to me).
When using a macro, the failure report does not include a line number that could be used to navigate to the test.
Example of the report:
Reproduction: https://github.com/MatthiasKunnen/ava-line-number-reproduction.
AVA version: 3.15.0.
AVA configuration: See repo.
Proposal
Capture the line number when
test
is invoked and either add it to the stack trace or add it above the diff, e.g.typescript/spec/something.spec.ts:7
Notes
Interestingly, the report is a bit different when the macro is inside vs outside the spec file. This can be seen on the root commit in the reproduction repository. Example diff with the
+
side representing a macro outside the spec file:The text was updated successfully, but these errors were encountered: