jest-extended
jest-extended copied to clipboard
`toHaveBeenCalledOnceWith` does not work with Symbols
const fn = jest.fn();
const symbol = Symbol('foo');
fn(symbol);
expect(fn).toHaveBeenCalledWith(symbol); // jest : right
expect(fn).toHaveBeenCalledWith(Symbol('foo')); // jest : wrong
expect(fn).toHaveBeenCalledOnceWith(symbol); // jest-extended : right
expect(fn).toHaveBeenCalledOnceWith(Symbol('foo')); // jest-extended : right (but should be wrong)
@aduponchel I tried to reproduce the same scenario in this project: https://github.com/verdecchia/jest-extended-symbols-532
expect(fn).toHaveBeenCalledWith(Symbol('foo'));
and
expect(fn).toHaveBeenCalledOnceWith(Symbol('foo'));
both fail but with different error messages.