How to use the @shopify/react-testing.createMount function in @shopify/react-testing

To help you get started, we’ve selected a few @shopify/react-testing examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Shopify / polaris-react / src / test-utilities / react-testing.tsx View on Github external
import React from 'react';
import {createMount, mount} from '@shopify/react-testing';
import translations from '../../locales/en.json';

import {
  PolarisTestProvider,
  WithPolarisTestProviderOptions,
} from '../components';

export {mount};

export const mountWithApp = createMount<
  WithPolarisTestProviderOptions,
  WithPolarisTestProviderOptions
>({
  context(options) {
    return options;
  },
  render(element, context) {
    return (
      
        {element}
      
    );
  },
});

@shopify/react-testing

A library for testing React components according to our conventions

MIT
Latest version published 3 months ago

Package Health Score

62 / 100
Full package analysis

Popular @shopify/react-testing functions