vitest-dev / vitest-dev/vscode
Strip noisy `.test.ts` suffixes from file names in test explorer tree
Nobody has claimed this yet.
- 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
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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