Jest Testing Meteor React Component that uses withTracker in the container (meteor / meteor reaction data)

I am testing a component using withTrackerin my container.

An error has occurred:

TypeError: (0, _reactMeteorData.withTracker) is not a function.

I think that I have not yet mocked the reaction-meteor data / withTracker. Can someone tell me how to mock this? Or is there some solution for this?

+4
source share
1 answer

Inspired How does the Meteor function with the Tracker function execute differently than the first createContainer reactive container function? I was able to update the tests from createContainer to Tracker using the following:

response-meteor-data.js.

const createContainer = jest.fn((options = {}, component) => component );

const withTracker = jest.fn(Op => jest.fn(C => createContainer(Op, C)));

Tracker createContainer.

0

Source: https://habr.com/ru/post/1690218/


All Articles