-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Coverage with Changed #5237
Comments
We are waiting for this too |
I'm planning to focus on this next. Starting probably this or next week. Before starting we'll need a smaller minimal reproduction setup with clear goals of what should be seen on coverage report. The linked project is too big for this. If you want to help and see this feature implemented faster, please help setting up a minimal reproduction that's dedicated for this. |
There's now a minimal reproduction setup at https://github.com/AriPerkkio/reproductions, branch There's also branch
In Vitest we should be able to pick up all dependencies that the changed file has and be able to add those as uncovered. So we should not show only the coverage of the changed files, but also the coverage of their dependencies. |
Also
// src/source-file.ts
export function first() {
return true;
}
export function second() {
return true;
}
// test/first.test.ts
import { first } from '../src/source-file';
test("first", () => {
first();
});
// test/second.test.ts
import { second } from '../src/source-file';
test("second", () => {
second();
}); Now make change to
|
I wonder if a file without tests will be included in the coverage? |
Yes, changed (or newly created) files without tests should show up with |
Clear and concise description of the problem
--coverage
+--changed
don't work well together. Coverage doesn't do anything special when --changed is passed.There are files for which there are no tests.
I created an example where you can see it.
https://gitlab.com/bad4iz/file-signature-in-react/-/merge_requests/92
src/component/SelectCert.Copy.tsx
and just the second problem. It's strange how the coverage works with
--changes
+coverage
vitest --coverage.enabled --changed=origin/develop --coverage.all=true
https://gitlab.com/bad4iz/file-signature-in-react/-/jobs/6198442714
and
vitest --coverage.enabled --coverage.all=true
https://gitlab.com/bad4iz/file-signature-in-react/-/jobs/6198442715
I think this is an important.
feature to write tests at all. And I think it's not worth running all the tests mr or pr to make sure that you didn't forget to test some file.
what is the point of measuring the coverage of the entire project? to increase it. and this is not present now in
--coverage
+--changed
Suggested solution
--coverage
+--changes
show the coverage of files that do not have tests..--coverage
+--changes
shows true information about coverageAlternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: