vitest-dev / vitest-dev/vitest
`it.todo` / `it.skip` in `.test-d.ts` files should suppress type errors attributed to skipped tests
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 17.1k
- Forks
- 2k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 94
Description
Describe the bug
I am using it.todo in a .test-d.ts file to mark a type test as "not yet passing."
I expect vitest to suppress type errors inside .todo (and .skip) tests, since it already attributes type errors to specific it() blocks.
What actually happens is that tsc typechecks the body regardless, and vitest reports the type error as a top-level "Typecheck Error", failing the suite — even though the test shows as "todo" in the output.
Reproduction
https://github.com/joshuahhh/vitest-todo-typecheck-repro
npm install && npm test to reproduce.
System Info
System:
OS: macOS 15.5
CPU: (12) arm64 Apple M2 Pro
Memory: 105.08 MB / 16.00 GB
Shell: 3.7.1 - /opt/homebrew/bin/fish
Binaries:
Node: 22.22.1
npm: 10.9.4
npmPackages:
vitest: ^4.1.0 => 4.1.0
Used Package Manager
npm
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.
Contributor guide
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 with the linked reproduction and run npm install && npm test to observe the failure in the .test-d.ts file. Trace how Vitest attributes type errors to it() blocks, then verify that errors inside it.todo and it.skip are suppressed while those tests remain marked todo or skipped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100