Trouble Stubbing Shopify OAuth APIs in Node.js with [@shopify/shopify-api] Package

Trouble Stubbing Shopify OAuth APIs in Node.js with [@shopify/shopify-api] Package

afraz-khan
Shopify Partner
3 0 0

Hi there!

I'm currently developing a Shopify App in Node.js and have successfully implemented Shopify OAuth using the @shopify/shopify-api package. Now, I'm facing challenges while trying to write tests for the OAuth-related code.

Specifically, I'm having difficulty stubbing the Shopify Client for OAuth APIs. The methods causing issues are:

I've attempted to use Sinon Stubs, but haven't been successful so far. It's possible that there's some intricacy with the HTTP response handling in these API methods that I'm not fully understanding.

If anyone has experience with stubbing these methods for testing purposes or can provide insights into the nuances of handling HTTP responses in this context, I would greatly appreciate your assistance.


Thank you in advance for your help!

Replies 0 (0)