-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
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
git clone https://github.com/davemfish/repro-vitest-annotation
cd repro-vitest-annotation
yarn test
System Info
λ npx envinfo --system --npmPackages '{vitest,@vitest/*,vite,@vitejs/*}' --binaries --browsers
npx: installed 1 in 2.539s
System:
OS: Windows 10 10.0.19045
CPU: (12) x64 AMD Ryzen 5 1600 Six-Core Processor
Memory: 12.73 GB / 31.95 GB
Binaries:
Node: 18.14.2 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.11 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.14.11 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 114.0.5735.199
Edge: Spartan (44.19041.1266.0), Chromium (114.0.1823.79)
Internet Explorer: 11.0.19041.1566Used Package Manager
yarn
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable