Skip to content

toEqual output is truncated #2448

@rcoundon

Description

@rcoundon

Describe the bug

When running a test to check the equality of two objects, the output is truncated if there are more than 2 properties.

I.e. the output looks like this:
AssertionError: expected { hello: 'world', …(3) } to deeply equal { hello: 'world', …(2) }
Which means it's not possible to establish what was wrong.

I wondered if setting this might help but it doesn't seem to make a difference here

Reproduction

In this repo there's a test called it demonstrates toEqual output is truncated in ApiCaller.test.ts that shows the problem.

System Info

"vite": "3.2.5",
"vitest": "0.25.4",

System:
    OS: macOS 12.6.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 814.89 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.12.1/bin/yarn
    npm: 9.1.3 - ~/.nvm/versions/node/v18.12.1/bin/npm
  Browsers:
    Brave Browser: 108.1.46.134
    Chrome: 108.0.5359.94
    Edge: 108.0.1462.41
    Firefox Developer Edition: 108.0
    Safari: 16.1

"vite": "3.2.5",
"vitest": "0.25.4",

Used Package Manager

yarn

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions