I am using shopify-api module in my application and I want to test it by mocking it with jest. The shopify-api is a class based module and in that module, I want to mock the post method in a way that I want this post function to return some data. Below is how I have tried it. it('imports product into shopify', async () => { const client = new Shopify.Clients.Rest( shopifyMocks.shop, shopifyMocks.accessToken );...
Originally asked by Nabeel Munir on Stack Exchange (stackoverflow) (CC BY-SA 4.0).