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 not created in Monorepo #394

Closed
4 tasks done
spence-novata opened this issue May 22, 2024 · 6 comments
Closed
4 tasks done

Coverage not created in Monorepo #394

spence-novata opened this issue May 22, 2024 · 6 comments
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@spence-novata
Copy link

Describe the bug

I don't believe this is a duplicate or regression of #372

When running in a monorepo I'm not getting any coverage reports. If I open vscode on the individual package I get coverage fine. But in a monorepo nothing.

The test itself seems to pass (or fail) correctly. There are no errors in the Output. I pulled the path to the reportsDirectory from the output and that directory doesn't exist.

Reproduction

https://github.com/spence-novata/vitest-monorepo-coverage-repro

Output

[Worker] Running coverage with configuration: {
  provider: 'v8',
  enabled: false,
  all: false,
  clean: true,
  cleanOnRerun: true,
  reportsDirectory: '/var/folders/20/6348r3fs213djqtyzz7f3npm0000gn/T/vitest-coverage-a07c9b9c-d99c-4aa7-bac5-e49fa13c9f40',
  exclude: [
    'coverage/**',
    'dist/**',
    '**/[.]**',
    'packages/*/test?(s)/**',
    '**/*.d.ts',
    '**/virtual:*',
    '**/__x00__*',
    '**/\x00*',
    'cypress/**',
    'test?(s)/**',
    'test?(-*).?(c|m)[jt]s?(x)',
    '**/*{.,-}{test,spec}?(-d).?(c|m)[jt]s?(x)',
    '**/__tests__/**',
    '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
    '**/vitest.{workspace,projects}.[jt]s?(on)',
    '**/.{eslint,mocha,prettier}rc.{?(c|m)js,yml}',
    'vitest.setup.ts',
    'vitest.setup.ts',
    'vitest.setup.ts'
  ],
  reportOnFailure: true,
  reporter: [ [ 'json', {} ] ],
  extension: [
    '.js',    '.cjs',
    '.mjs',   '.ts',
    '.mts',   '.cts',
    '.tsx',   '.jsx',
    '.vue',   '.svelte',
    '.marko'
  ],
  allowExternal: false,
  ignoreEmptyLines: false,
  processingConcurrency: 10
}
[INFO 7:50:27 AM] Running 1 file(s): packages

Version

0.10.7

Validations

@motss
Copy link

motss commented May 22, 2024

@spence-novata Make sure your test.coverage.enabled is set to true in vite.config.ts.

@spence-novata
Copy link
Author

This did the trick thank you

@sheremet-va
Copy link
Member

You shouldn't need to change your config for coverage to work

@sheremet-va sheremet-va reopened this May 23, 2024
@sheremet-va sheremet-va added p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels May 23, 2024
@motss
Copy link

motss commented May 23, 2024

You shouldn't need to change your config for coverage to work

However that's not the case for the extension as it requires us to enable the coverage in our config file. This was first found here and receives np further response from the team.

@sheremet-va
Copy link
Member

sheremet-va commented May 23, 2024

You shouldn't need to change your config for coverage to work

However that's not the case for the extension as it requires us to enable the coverage in our config file. This was first found here and receives np further response from the team.

This is a bug in the extension, not a feature. After that comment, there were bug fixes that removed that requirement (https://github.com/vitest-dev/vscode/releases/tag/v0.10.0). If it's still needed in some cause, this is a bug.

@motss
Copy link

motss commented May 23, 2024

You shouldn't need to change your config for coverage to work

However that's not the case for the extension as it requires us to enable the coverage in our config file. This was first found here and receives np further response from the team.

This is a bug in the extension, not a feature. After that comment, there were bug fixes that removed that requirement (https://github.com/vitest-dev/vscode/releases/tag/v0.10.0). If it's still needed in some cause, this is a bug.

That's new to me. Let me test that again and raise a bug if needed.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

No branches or pull requests

3 participants