Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type test file is being rerun (with typecheck enabled) instead of the regular test file when saving after changes #5020

Open
6 tasks done
murolem opened this issue Jan 21, 2024 · 0 comments
Labels
feat: typecheck Issues and PRs related to typechecking feature pending triage

Comments

@murolem
Copy link

murolem commented Jan 21, 2024

Describe the bug

When saving in a regular test file index.test.ts after making changes, the type test file index.test-d.ts is being rerun instead of the current test file index.test.ts.

Current solution is to save, wait for the rerun of the other file, and save again (without making any changes).

Reproduction

Repo: https://github.com/murolem/vitest-issue-wrong-file-rerun-on-save-with-typecheck-enabled

Steps:

  1. Run npm run test. Note both tests being run.
  2. Go to the regular test file index.test.ts and make some changes, e.g. make a comment.
  3. Save the file.

Expected:
Rerun occurs on the current test file index.test.ts.

Actual:
Rerun occurs on the type test file index.test-d.ts.

System Info

System:
    OS: Windows 11 10.0.22621
    CPU: (16) x64 AMD Ryzen 7 5800X 8-Core Processor
    Memory: 8.93 GB / 31.93 GB
  Binaries:
    Node: 21.1.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (120.0.2210.144)
  npmPackages:
    vite: ^5.0.11 => 5.0.11
    vitest: ^1.2.1 => 1.2.0

Used Package Manager

npm

Validations

@murolem murolem changed the title Type test file is being rerun instead of the regular test file when using typecheck and saving after changes in the regular test file Type test file is being rerun (with typecheck enabled) instead of the regular test file when saving after changes Jan 21, 2024
@hi-ogawa hi-ogawa added the feat: typecheck Issues and PRs related to typechecking feature label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: typecheck Issues and PRs related to typechecking feature pending triage
Projects
None yet
Development

No branches or pull requests

2 participants