vitest-dev / vitest-dev/vitest

`it.todo` / `it.skip` in `.test-d.ts` files should suppress type errors attributed to skipped tests

Open
#9,934 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feat: typecheck pending triage
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

Contributor guide

Open the contributing guide

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.