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
Console annotations of test failures -- specifically the red ^ -- often appears on the wrong line and at the wrong character.
In my real code I was tricked into thinking the earlier assertions were passing when they were not.
The behavior seems to be a function of the number of lines in the test file. For example, in my repro, note the ~10 lines preceding the test. If these are reduced to 1 or 2 lines, the annotation ends up in the correct place.
Reproduction
git clone https://github.com/davemfish/repro-vitest-annotation
cd repro-vitest-annotation
yarn test
Describe the bug
Console annotations of test failures -- specifically the red
![Capture](https://private-user-images.githubusercontent.com/4071255/253067236-3caa58ed-e248-494d-94d5-54af0c75ad4a.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE4NjIxODAsIm5iZiI6MTcyMTg2MTg4MCwicGF0aCI6Ii80MDcxMjU1LzI1MzA2NzIzNi0zY2FhNThlZC1lMjQ4LTQ5NGQtOTRkNS01NGFmMGM3NWFkNGEuUE5HP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjRUMjI1ODAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MGMzZmYyOGQ2ZmYzNTc0OGI4NWU5MzRkNGYzY2UxNjU0NzY4MzlmNzJkYWM5NTFmMGYyYjE0YTg4MmU0M2Y3OSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.24IR6-Q0m4V30Hbd0Jh1AaNjcAYTFsvcLQpSGVI0AzU)
^
-- often appears on the wrong line and at the wrong character.In my real code I was tricked into thinking the earlier assertions were passing when they were not.
The behavior seems to be a function of the number of lines in the test file. For example, in my repro, note the ~10 lines preceding the test. If these are reduced to 1 or 2 lines, the annotation ends up in the correct place.
Reproduction
System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: