Skip to content

[Bug]: toHaveBeenCalledWith does not differentiate [undefined] and [] arguments #15446

@vwinkler

Description

@vwinkler

Version

29.7.0

Steps to reproduce

Example steps (replace with your own):

  1. Clone my repo at https://github.com/vwinkler/jest_undefined_vs_empty_array_regression
  2. npm install
  3. npm test
  4. You should see the test results not matching my expectation

Expected behavior

× I expect this to fail
√ I expect this to pass

Actual behavior

√ I expect this to fail
× I expect this to pass

Additional context

This seems to be a regression. Jest 27 behaves as expected.

Environment

System:
    OS: Windows 11 10.0.26100
    CPU: (16) x64 AMD Ryzen 7 PRO 5850U with Radeon Graphics
  Binaries:
    Node: 16.18.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    jest: ^29.7.0 => 29.7.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions