Skip to content
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

Blank lines cause wrong line to be highlighted in vitest output #3943

Closed
6 tasks done
FeldrinH opened this issue Aug 14, 2023 · 1 comment
Closed
6 tasks done

Blank lines cause wrong line to be highlighted in vitest output #3943

FeldrinH opened this issue Aug 14, 2023 · 1 comment

Comments

@FeldrinH
Copy link

FeldrinH commented Aug 14, 2023

Describe the bug

Having blank lines in test code causes the highlighted line with the failing test to show the wrong part of the code.

Reproduction

import { expect, test } from 'vitest';





























test('example', () => {
    expect(false).toBeTruthy();
});
// a
// b
// c
// d

gives this output:

image

(Note that the line number shown after the file name is correct, but the highlighted line is wrong.)

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i5-13600KF
    Memory: 22.04 GB / 31.83 GB
  Binaries:
    Node: 18.15.0 - C:\Program Files\nodejs\node.EXE
    npm: 9.5.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.2.0 - ~\AppData\Local\pnpm\pnpm.EXE
  Browsers:
    N/A
  npmPackages:
    vitest: ^0.34.1 => 0.34.1

Used Package Manager

npm

Validations

@FeldrinH FeldrinH changed the title Blank lines cause wrong line to be highlighted Blank lines cause wrong line to be highlighted in vitest output Aug 14, 2023
@sheremet-va
Copy link
Member

Fixed by #3855, but not released yet

@github-actions github-actions bot locked and limited conversation to collaborators Aug 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants