Happening now | Office Hours: Customizing Your Theme with Moeed | Ask all your theme customization questions now!

How to do JavaScript testing for an embedded Shopify app?

How to do JavaScript testing for an embedded Shopify app?

graham12
Shopify Partner
1 0 1

Hi there,

 

I am looking for official guidance from Shopify on how I can go about doing JavaScript testing for an embedded application that uses Polaris.

 

There are two major problems that I have encountered while attempting to do some basic JavaScript testing:

 

  1. The Provider component from @Shopify/app-bridge-react cannot be mocked.
  2. Some components such as ResourcePicker from @Shopify/app-bridge-react cannot be mocked either because they depend on the Provider component from the previous point.

Are there any recommended approaches or guides on how resolve or workaround these issues?

 

Best,

 

Graham

Replies 0 (0)