Skip to content

Improve testing setup - snapshot testing for the formatter output, setup coverage for dev ux#203

Open
kevinramharak wants to merge 2 commits intoyoavbls:mainfrom
kevinramharak:feat/improve-tests
Open

Improve testing setup - snapshot testing for the formatter output, setup coverage for dev ux#203
kevinramharak wants to merge 2 commits intoyoavbls:mainfrom
kevinramharak:feat/improve-tests

Conversation

@kevinramharak
Copy link
Copy Markdown
Collaborator

Inspired by #186, specifically this comment #186 (comment), I figured to take another shot at improving the test setup, to make it easier to merge PR's with more confidence.

Changes:

  • update vitest to 4.x.x, no breaking changes for our uses, but it does make setting up code coverage easier.
  • add snapshot testing for @pretty-ts-errors/formatter, main reason I started this PR is to make changes to regexes with more confidence, as changes to the formatter output will break the tests, and require updating the snapshots explicitly. This should ensure changes in the output do not go unnoticed.
  • setup code coverage for @pretty-ts-errors/formatter and @pretty-ts-errors/vscode-formatter. So far no automation, nor will it be run in the CI, but when using vitest explorer it will give good (visual) feedback on what is and isn't covered by tests (screenshot below).
image

@kevinramharak kevinramharak requested a review from yoavbls March 30, 2026 11:08
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.

1 participant