Skip to content

Instantly share code, notes, and snippets.

@CodeNinja47
Created December 28, 2022 11:34
Show Gist options
  • Select an option

  • Save CodeNinja47/42da2fe7423928b3c0f4caaa981a2270 to your computer and use it in GitHub Desktop.

Select an option

Save CodeNinja47/42da2fe7423928b3c0f4caaa981a2270 to your computer and use it in GitHub Desktop.
import React from 'react';
import { render } from '@testing-library/react';
/**
*
* @param {React component} any React component
* @returns React component wrapped around with the store
*/
const Provider = ({ children }) => {
return <>
{children}
</>;
};
const customRender = (ui, options) => render(ui, { wrapper: Provider, ...options });
// override render method
export { customRender };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment