How to do JavaScript testing for an embedded Shopify app?

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_77 /app-bridge-react cannot be mocked.
  2. Some components such as ResourcePicker from @Shopify_77 /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

1 Like