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

UI coverage list filters/shrinks during watch #6225

Closed
6 tasks done
alexcroox opened this issue Jul 26, 2024 · 1 comment · Fixed by #6592
Closed
6 tasks done

UI coverage list filters/shrinks during watch #6225

alexcroox opened this issue Jul 26, 2024 · 1 comment · Fixed by #6592
Labels
feat: coverage Issues and PRs related to the coverage feature p2-nice-to-have Not breaking anything but nice to have (priority)

Comments

@alexcroox
Copy link

alexcroox commented Jul 26, 2024

Describe the bug

I'm trying to add tests to my project. I'm using the coverage UI to help me navigate this task and see where the gaps in testing are.

When the UI first launches I see all files in the coverage "all files" section.

However as I save tests the list shrinks, and might only show the file I just saved in a specific folder, rather than the other files that were previously visible. I think this has something to do with --watch where it only runs against files you just changed, but I want to always see all files so I can work through them.

Currently I have to keep restarting the process to get the full file list back.

Reproduction

I'm launching with: vitest --watch --config tests/vitest.unit-config.ts --ui

I've tried the test.coverage.all: true option

import { defineVitestConfig } from '@nuxt/test-utils/config'

export default defineVitestConfig({
  test: {
    environment: 'happy-dom',
    globals: true,
    watch: false,
    clearMocks: true,
    mockReset: true,
    restoreMocks: true,
    setupFiles: ['./tests/unit/unitSetup.ts'],
    include: ['./**/*.spec.ts'],
    exclude: ['./node_modules', './dist', './.nuxt', './coverage', './tests/e2e', './**/*.e2e.spec.ts'],
    chaiConfig: {
      truncateThreshold: 0
    },
    coverage: {
      enabled: true,
      provider: 'v8',
      all: true,
      reportsDirectory: '../tests/unit/coverage'
    }
  }
})

System Info

System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Pro
    Memory: 513.00 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node
    npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm
  Browsers:
    Chrome: 126.0.6478.185
    Safari: 17.5
    Safari Technology Preview: 18.0
  npmPackages:
    @vitejs/plugin-vue: 5.0.5 => 5.0.5
    @vitest/coverage-v8: 2.0.4 => 2.0.4
    @vitest/ui: 2.0.4 => 2.0.4
    vitest: 2.0.4 => 2.0.4

Used Package Manager

npm

Validations

@alexcroox alexcroox changed the title UI coverage list keeps filtering/shrinking during watch UI coverage list filters/shrinks during watch Jul 26, 2024
@sheremet-va sheremet-va added p2-to-be-discussed Enhancement under consideration (priority) and removed pending triage labels Jul 31, 2024
@sheremet-va sheremet-va moved this to P2 - 3 in Team Board Jul 31, 2024
@sheremet-va sheremet-va moved this from P2 - 3 to Approved in Team Board Sep 26, 2024
@sheremet-va sheremet-va added p2-nice-to-have Not breaking anything but nice to have (priority) and removed p2-to-be-discussed Enhancement under consideration (priority) labels Sep 26, 2024
@AriPerkkio
Copy link
Member

Requires #5521 (comment)

@AriPerkkio AriPerkkio added the feat: coverage Issues and PRs related to the coverage feature label Sep 26, 2024
AriPerkkio added a commit to AriPerkkio/vitest that referenced this issue Sep 29, 2024
AriPerkkio added a commit to AriPerkkio/vitest that referenced this issue Sep 29, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: coverage Issues and PRs related to the coverage feature p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants