Replies: 1 comment
-
The location in the json reporter is just the first error location, it's not the same value that jest uses. It is a bug. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Reproduction here: https://stackblitz.com/edit/vitest-dev-vitest-mfg2jr?file=package.json&view=editor
I am unsure if this intentional or a bug, so I thought I ask here first.
It seems there might be a bug in the line number reported by the json reporter, in that it is taking the first line of the stack trace and using the line number there, regardless whether that is the file under test. This works fine in some cases, but when using something like testing-library and the error occurs in something like a
screen.getByText()
, the first line of the stack trace is coming from testing-library instead.In the above, other reporters correctly highlight
input.test.tsx:20:19
as the line producing the failing test, but json reporter shows this:Is this a legitimate bug?
Beta Was this translation helpful? Give feedback.
All reactions