Skip to content
Discussion options

You must be logged in to vote

It is possible. You need to run vitest on each shard with coverage enabled, then combine each shard report using --merge-reports. Here's an Azure Pipelines example

  - job: UnitTest
    displayName: 'Unit Test Shard'
    pool:
      vmImage: 'ubuntu-latest'

    strategy:
      parallel: 2

    steps:
      - task: UseNode@1
        inputs:
          version: '24.x'

      - script: yarn install --immutable
        displayName: Install Dependencies

      - script: |
          yarn vitest run \
          --shard=$(System.JobPositionInPhase)/$(System.TotalJobsInPhase) \
          --reporter=blob \
          --coverage
        displayName: Run Unit Tests
        env:
          VITEST_SHARD:…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by donalmurtagh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant