Open g-tiwari opened 1 year ago
Hi @g-tiwari, I might recommend a metro config override where you could swap out a real module with a mocked one containing a data fixture.
For example:
This would be the real file myApi.ts
export const getProfile = () => fetch('https://myapi.com/me');
And this would be your mock myApi.e2emock.ts
:
export Promise.resolved({ username: 'asdf' });
Your metro override would prioritize one file extension over another depending on whether an environment variable is set or not.
IMO, support for mocking like this should fall outside of the scope of Owl here, but there are definitely ways to achieve what you're looking for.
Is there any capability exist to mock the backend test data and then load my page with that data. As of now for some of my screens the data is dynamic and React native owl end up showing that as bug for every test run. Are we planning to add support to add mocking ?