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

reporters return inconsistent results when no tests are found #7076

Open
6 tasks done
amirgalor-gong opened this issue Dec 12, 2024 · 1 comment
Open
6 tasks done

Comments

@amirgalor-gong
Copy link

Describe the bug

Hi, I've tried this with both 'html', 'junit' reporters turn on.
the behavior is not consist between the two reporters, and is also in consistent with Jest, and other frameworks.

html reporter does not create anything
junit reporter creates an empty file (0 bytes)

With other frameworks the expected behavior of both is to create an empty set result in file, so other tools can parse and act accordingly.

Reproduction

Please see following link:
https://stackblitz.com/edit/vitest-dev-vitest-eucg6sat?file=package.json

the reproduction will auto-run a vitest in "related" mode, which finds zero tests.

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @vitest/ui: latest => 2.1.8 
    vite: latest => 5.4.11 
    vitest: latest => 2.1.8

Used Package Manager

npm

Validations

@AriPerkkio
Copy link
Member

This might be related to #6968 (comment). If Vitest doesn't indicate onFinish to reporters when no files were run, most reports won't output anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants