EquilibriumOfMyOwn
EquilibriumOfMyOwn

Reputation: 11

Avoid including coverage folder created from running yarn coverage using vitest in git commit

Our team is using vitest, vitest-environment-nuxt, nuxt-vitest for component unit testing,provider for creating coverage report is v8,using package @vitest/coverage-v8. What I want to achieve is excluding coverage folder generated after running command vitest run --coverage.

Trying to add "coverage" in .gitignore file but it seems doesn't work for me. Whenever I run git status, there will be lines indicate that files in coverage folder are modified. Any advice would be perfect. Thank you!

Upvotes: 1

Views: 788

Answers (1)

parikkap
parikkap

Reputation: 31

You should be able to achieve this with the following steps:

  1. Remove the whole coverage folder.
  2. Commit changes
  3. Add coverage/* line to .gitignore
  4. Commit changes
  5. Run test coverage vitest --coverage.enabled true
  6. Run git status
  7. Coverage files should not appear in dif
  8. Push changes

Upvotes: 2

Related Questions