мокаю в тесте
jest.mock('../smeta_transport_costs', () => {
return {
__esModule: true,
default: () => {
return <div>Mocked SmetaTransportCostItem</div>;
},
};
});
тест expect(screen.getByText('Mocked SmetaTransportCostItem')).toBeInTheDocument(); - проходит без проблем
тест
expect(SmetaTransportCostItem as jest.Mock).toHaveBeenCalledWith(
expect.objectContaining({
data: [
{transportKind: 'Автобус', tripsQty: 2, peopleQty: 3, costPerTrip: 100, totalCost: 600, fromTo:"soch/adler",infoSrc:'site'},
],
handleChangeSmeta: expect.any(Function),
headers: expect.any(Array),
}),
{}
);
Выдает ошибку
Error: expect(received).toHaveBeenCalledWith(...expected)
Matcher error: received value must be a mock or spy function
Received has type: function
Received has value: [Function default]
не могу понять в чем дело , пробовал разные варианты мокания