vitest icon indicating copy to clipboard operation
vitest copied to clipboard

add storybook coverage exclude entries

Open ndelangen opened this issue 11 months ago • 2 comments

Description

Storybook stories can be considered test, especially with the storybook test plugin for vitest in the works, they are converted into test files.

When enabling coverage in that scenario, it's undesired to have the story files count for measuring coverage.

Therefore is useful for those files to be excluded.

It would be possible for vitest users to configure this, however we think it could be useful to add this to the default set of coverage exclude patterns inside of vitest itself.

More context here: https://github.com/storybookjs/storybook/issues/29613

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • [ ] It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • [ ] Ideally, include a test that fails without this PR but passes with it.
  • [ ] Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • [ ] Run the tests with pnpm test:ci.

Documentation

  • [ ] If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • [ ] Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

ndelangen avatar Dec 04 '24 15:12 ndelangen

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
Latest commit 8e8173f34a2c6b84f6ff6bca4a6af5c45ebe9514
Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/67507d8872db8a000840e832
Deploy Preview https://deploy-preview-7020--vitest-dev.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Dec 04 '24 16:12 netlify[bot]

We are considering removing all non-Vitest related defaults from coverage.exclude, see:

  • https://github.com/vitest-dev/vitest/issues/6956

AriPerkkio avatar Dec 04 '24 16:12 AriPerkkio