Skip to content

test result diff output containing recursive data never completes #3261

@rolandjohann

Description

@rolandjohann

Describe the bug

We currently setup vitest to test our react components with @resting-lib/react. During the setup we made some mistakes that lead to never completing test runs. After some deep debugging and comparison to jest we discovered that the diff output of some (not so deep) JSX trees contain recursive data structures which cause the test run not to complete. Choosing another reporter, like 'junit' solves the issue completely.

There had been a implementation to limit the diff output, that got lost at a huge change
0f86ff9#diff-1e7604160ec072ba6c4059a1b3c588946c3765ce2944002ef1ece1e438014410L8

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-kkdcxs?file=package.json

This setup uses "vitest": "latest" and reproduces the issue. Downgrading vitest to 0.29.8 resolves the issue.

System Info

System:
    OS: macOS 12.5
    CPU: (10) arm64 Apple M1 Max
    Memory: 8.69 GB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
    Yarn: 1.22.17 - /opt/homebrew/bin/yarn
    npm: 8.3.1 - ~/.nvm/versions/node/v16.14.0/bin/npm
  Browsers:
    Chrome: 112.0.5615.137
    Safari: 15.6
  npmPackages:
    @vitest/ui: latest => 0.30.1
    vite: latest => 4.3.2
    vitest: latest => 0.30.1

Used Package Manager

yarn

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions