vitest-dev / vitest-dev/vscode

Strip noisy `.test.ts` suffixes from file names in test explorer tree

Open
#821 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement: pending triage
Dominant language
TypeScript
Stars
924
Forks
122
Avg merge
1d 14h
Merged PRs (30d)
6

Description

Clear and concise description of the problem

The test explorer shows test files as the literal file name, e.g. user.test.ts, which results in a lot of visual noise I have to ignore.

I would like an option to strip the .test.ts suffix, leaving just user. I'd be happy to implement and PR!

Suggested solution

Add a setting to the Vitest extension to remove file suffixes. We'd also need to support different test conventions, like .test.js, .spec.ts, etc.

Alternative

I imagine some people will still prefer having the explicit suffix to reflect the file system, so we should disable stripping by default, leaving it opt-in only?

Additional context
Image
Validations

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the test explorer tree's file-name rendering and the extension settings that control its display. Review how test file conventions are represented, including .test.js, .test.ts, and .spec.ts. Done means an opt-in setting strips the selected suffixes while leaving the explicit file names unchanged by default.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.