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

Debug test throws Error: No test suite found in file if project is located on D: drive #548

Open
4 tasks done
armbzk opened this issue Dec 3, 2024 · 5 comments
Open
4 tasks done
Labels
p4-important Violate documented behavior or significantly improves performance (priority)

Comments

@armbzk
Copy link

armbzk commented Dec 3, 2024

Describe the bug

Description

  • Running Debug test in vscode vitest extension fails with Error: No test suite found in file D:/gitea/armbzk/vitest-update/tests/dummy.test.mjs
  • Error only occurs with Debug test - Run test succeeds without any error
  • after copying the project to Windows C: drive Debug test works fine
  • npx vitest run in console succeeds (also on D: drive)

Environment

  • vscode 1.95.3
  • OS: Windows_NT x64 10.0.26100 (Windows 11)
  • Nodejs: 20.18.0
  • npm 10.9.1
  • vscode vitest extension v1.8.1
  • vitest 2.1.7
  • MSYS2 GNU bash, version 5.2.37(1)-release (x86_64-pc-msys)

Reproduction

Link to gihub repo: https://github.com/armbzk/vitest-error

tests/dummy.test.mjs:

import { describe, expect, it } from 'vitest';

describe('dummy tests', () => {
    it('should succeed', () => {
        expect(true).toBe(true);
    });
});

vitest.config.mts:

import { defineConfig } from 'vitest/config';

export default defineConfig({
    test: {
        environment: 'node',
        include: [
            'tests/*.test.{js,mjs}',
        ],
    },
});

package.json:

{
  "devDependencies": {
    "vitest": "^2.1.7"
  },
  "scripts": {
    "test": "npx vitest run"
  }
}

Output

Output in vscode DEBUG console:

C:\Program Files\nodejs\node.EXE c:\Users\armbzk\.vscode\extensions\vitest.explorer-1.8.1\dist\worker.js
Process exited with code 1

Error message in vitest test explorer:

Error: No test suite found in file D:/gitea/armbzk/vitest-update/tests/dummy.test.mjs
at runFiles (file:///digitea/armbzk/vitest-update/node_modules/@vitest/runner/dist/index.js:1254:11)
at startTests (file:///digitea/armbzk/vitest-update/node_modules/@vitest/runner/dist/index.js:1271:9)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at file:///digitea/armbzk/vitest-update/node_modules/vitest/dist/chunks/runBaseTests.3qpJUEJM.js:126:11
at withEnv (file:///d:/gitea/armbzk/vitest-update/node_modules/vitest/dist/chunks/runBaseTests.3qpJUEJM.js:90:5)
at run (file:///digitea/armbzk/vitest-update/node_modules/vitest/dist/chunks/runBaseTests.3qpJUEJM.js:112:3)
at runBaseTests (file:///d:/gitea/armbzk/vitest-update/node_modules/vitest/dist/chunks/base.BZZh4cSm.js:29:3)
at ForksBaseWorker.executeTests (file:///digitea/armbzk/vitest-update/node_modules/vitest/dist/workers/forks.js:27:7)
at execute (file:///d:/gitea/armbzk/vitest-update/node_modules/vitest/dist/workerjs:127:5)
at onMessage (file:///d:/gitea/armbzk/vitest-update/node_modules/tinypool/dist/entry/processjs:55:20)

Version

v1.8.1

Validations

@sheremet-va
Copy link
Member

What version of Vitest are you using?

@armbzk
Copy link
Author

armbzk commented Dec 3, 2024

  • vscode vitest extension v1.8.1
  • vitest 2.1.7

@Skrypt
Copy link

Skrypt commented Dec 3, 2024

I'm getting the same issue but it happens only when trying to debug a Vitest unit test in VS Code.
Running "npx vitest" works though.

image

using:

Vitest 2.1.8
VS Code Vitest extension v1.8.1
Node: 22.11

@Skrypt
Copy link

Skrypt commented Dec 4, 2024

I reverted to
Vitest 2.0.0 and now it works.

@Skrypt
Copy link

Skrypt commented Dec 4, 2024

Starts failing at 2.1.4

@sheremet-va sheremet-va added p4-important Violate documented behavior or significantly improves performance (priority) and removed pending triage labels Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4-important Violate documented behavior or significantly improves performance (priority)
Projects
None yet
Development

No branches or pull requests

3 participants