Skip to content

fix: normalize Windows drive letter when matching test failure stacks#796

Open
afrasso wants to merge 1 commit into
vitest-dev:mainfrom
afrasso:fix/windows-drive-letter-diagnostic
Open

fix: normalize Windows drive letter when matching test failure stacks#796
afrasso wants to merge 1 commit into
vitest-dev:mainfrom
afrasso:fix/windows-drive-letter-diagnostic

Conversation

@afrasso

@afrasso afrasso commented Jun 18, 2026

Copy link
Copy Markdown

Summary

  • Fix Windows test failure squiggles not appearing when vitest.applyDiagnostic is enabled
  • Normalize the test item file path with normalizeDriveLetter() in parseLocationFromStacks, matching how stack paths are already normalized

Fixes #795

Problem

On Windows, Vitest stack frames use an uppercase drive letter (C:\...) while VS Code's testItem.uri.fsPath uses lowercase (c:\...). parseLocationFromStacks only normalized the stack side, so the path comparison failed and the extension logged "Could not find a valid stack" instead of drawing a diagnostic squiggle.

Test plan

  • On Windows, open a project with Vitest tests
  • Enable vitest.applyDiagnostic (default)
  • Run a failing test from the Testing panel
  • Confirm a squiggle appears on the failing expect(...) line
  • Confirm CI passes (pnpm typecheck, pnpm test, pnpm test-e2e)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test failure squiggles don't appear on Windows (drive letter path mismatch)

1 participant