Skip to content

toBeCalledWith failure output is weird with multiple mismatched calls #7884

Closed
@bandersongit

Description

🐛 Bug Report

test("reproduce issue", () => {
    let fn = jest.fn();
    fn(1);
    fn(2);
    fn(3);

    expect(fn).toBeCalledWith((5));
});

yields
image

Expected behavior

Maybe a list of what is called with? Something like the failure output for the toBeCalled() matcher

Run npx envinfo --preset jest

Paste the results here:

Environment:
  OS:  macOS High Sierra 10.13.6
  Node:  8.11.1
  Yarn:  1.12.1
  npm:  5.6.0
  Watchman:  4.9.4
  Xcode:  Xcode 9.4.1 Build version 9F2000
  Android Studio:  3.2 AI-181.5540.7.32.5056338

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions