Skip to content

@vitest/coverage-v8@1.3.1 hangs indefinitely with Nestjs #5252

@noahw3

Description

@noahw3

Describe the bug

Using the @vitest/coverage-v8 package with the latest version hangs while mocking a project using nestjs. Output prints JUNIT report written to [path]/coverage/unit/junit.xml and then the process does not exit, with no coverage report being output. This does not occur as of version 1.3.0. I'm guessing that it has something to do with the changes made to decorators in #5206, as Nest makes heavy use of decorators.

Reproduction

Technically this version does resolve after hanging for ~30 seconds, but hopefully that should be enough to highlight the issue.

https://github.com/noahw3/vitest/tree/main/examples/basic

System Info

We also observed this in our CI environment, though it also reproduced locally.

  System:
    OS: macOS 14.1.2
    CPU: (10) arm64 Apple M1 Pro
    Memory: 623.30 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.5.0 - ~/.nvm/versions/node/v18.15.0/bin/npm
    pnpm: 8.10.0 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 121.0.6167.184
    Safari: 17.1.2
  npmPackages:
    @vitest/coverage-v8: 1.3.1 => 1.3.1 
    vitest: 1.3.1 => 1.3.1

Used Package Manager

pnpm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: coverageIssues and PRs related to the coverage featurep3-significantHigh priority enhancement (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions