We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm using Vitest in a monorepository (with vitest.workspace.ts), and it looks like the only way to provide coverage options is through CLI.
vitest.workspace.ts
The command I use includes this filter: --coverage.exclude='**/node_modules/**', which causes Vitest to throw this error:
--coverage.exclude='**/node_modules/**'
TypeError: resolved.coverage.exclude.push is not a function
In a monorepository that leverages Vitest Workspaces, run this command:
npx vitest run --coverage.enabled --coverage.lines=50 --coverage.functions=50 --coverage.branches=50 --coverage.statements=50 --coverage.all --coverage.include='packages/**' --coverage.include='apps/**' --coverage.exclude='**/node_modules/**'
System: OS: macOS 12.6.3 CPU: (10) arm64 Apple M1 Max Memory: 2.26 GB / 32.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.18.1 - ~/.nvm/versions/node/v16.18.1/bin/node Yarn: 3.2.3 - ~/.nvm/versions/node/v14.20.0/bin/yarn npm: 8.19.2 - ~/.nvm/versions/node/v16.18.1/bin/npm Browsers: Brave Browser: 109.1.47.171 Chrome: 113.0.5672.126 Firefox: 113.0.2 Safari: 16.3 npmPackages: @vitest/coverage-c8: ^0.31.1 => 0.31.1 @vitest/ui: ^0.31.1 => 0.31.1 vitest: ^0.31.1 => 0.31.1
yarn
The text was updated successfully, but these errors were encountered:
You can provide coverage options inside a vitest.config.ts
vitest.config.ts
Sorry, something went wrong.
I thought I was supposed to use defineProject (which doesn't support the coverage property) even at the root level. Thanks!
defineProject
coverage
We should probably guard all possible properties with toArray method.
toArray
Successfully merging a pull request may close this issue.
Describe the bug
I'm using Vitest in a monorepository (with
vitest.workspace.ts
), and it looks like the only way to provide coverage options is through CLI.The command I use includes this filter:
--coverage.exclude='**/node_modules/**'
, which causes Vitest to throw this error:Reproduction
In a monorepository that leverages Vitest Workspaces, run this command:
System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: