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

Coverage threshold bumper #1241

Closed
4 tasks done
tqn-treezor opened this issue May 5, 2022 · 1 comment · Fixed by #2886
Closed
4 tasks done

Coverage threshold bumper #1241

tqn-treezor opened this issue May 5, 2022 · 1 comment · Fixed by #2886
Assignees
Labels
enhancement New feature or request feat: coverage Issues and PRs related to the coverage feature

Comments

@tqn-treezor
Copy link

Clear and concise description of the problem

There is currently no way to insure continuous improvement regarding the test coverage, in the context of continuous integration.

Suggested solution

Provide a package such as the following: https://github.com/Litee/jest-coverage-thresholds-bumper
(And include it directly into the framework)

It could take the shape of a boolean property in vitest's defineConfig:

import { defineConfig } from 'vitest/config';

export default defineConfig({
  test: {
    coverage: {
      statements: 97.25,
      branches: 95.96,
      functions: 88.53,
      lines: 98,
      thresholdAutoUpdate: true,
    },
});

Alternative

No response

Additional context

I would love to have ideally 3 cases handled and clear logs when running vitest run --coverage:

  • The case where the coverages increased and "You may want to push with updated coverage thresholds"
  • The case where a coverage hasn't changed
  • The case where a coverage threshold hasn't been reached (already handled by the "standard" command)

Validations

@sheremet-va sheremet-va added the enhancement New feature or request label May 5, 2022
chaii3 pushed a commit to chaii3/vitest that referenced this issue May 13, 2022
@sheremet-va sheremet-va added the feat: coverage Issues and PRs related to the coverage feature label Jun 25, 2022
@AriPerkkio AriPerkkio self-assigned this Feb 18, 2023
@AriPerkkio
Copy link
Member

I'll start to work on this feature next. I'm not yet sure if we can support this in watch mode, since editing vitest.config.ts re-triggers the test run. If that cannot be easily disabled we might want to keep this for vitest run only.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request feat: coverage Issues and PRs related to the coverage feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants