-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fail message annotation points to the wrong line #3766
Comments
I test the following function (powershell, windows) export const getDouble = () : number => {
throw new Error("Today not possible");
} Given the function is at the very top of the file, I get the following message on the console, indicator to "e" in "new": ❯ Module.getDouble test/matte.ts:2:11
1| export const getDouble = () : number => {
2| throw new Error("Today not possible");
| ^
3| } Given I insert 10 blank lines, the red indicator moves 10 chars to the right, indicator to "T" in "Today": ❯ Module.getDouble test/matte.ts:12:11
1| export const getDouble = () : number => {
2| throw new Error("Today not possible");
| ^
3| } Given I insert 31 blank lines, the red indicator moves 31 chars to the right, indicator to SPACE behind ";": ❯ Module.getDouble test/matte.ts:33:11
31|
32| export const getDouble = () : number => {
33| throw new Error("Today not possible");
| ^
34| } |
Seems to be a line ending problem.
Module.getDouble test/matte.ts:33:11
31|
32| export const getDouble = () : number => {
33| throw new Error("Today not possible");
| ^
34| } |
Describe the bug
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
System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: