title: Is it possible to wrap each individual test in a wrapper component?
body: <p>I am using material-UI components in my React components. Therefore I will need to apply the <code>&lt;MuiThemeProvider&gt;&lt;/MuiThemeProvider&gt;</code> component around all my components in my tests.</p>
  
  <p>My components are located in individual folders:</p>
  
  <pre><code>./src/components/Header/Header.tsx
  ./src/components/Header/Header.test.ts
  ./src/components/Header/...
  ./src/components/Footer/Footer.tsx
  ./src/components/Footer/Footer.test.ts
  ./src/components/Footer/...
  // etc.
  </code></pre>
  
  <p>A test would have to look like the following:</p>
  
  <pre><code>import React from 'react';
  import { render } from '@testing-library/react';
  import Header from './Header';
  
  it('matches snapshot', () =&gt; {
    const container = render(
      // This theme provider is necessary since my components depend on it.
      // But rather don't want to include this in all my components. 
      &lt;MuiThemeProvider theme={theme}&gt;
        &lt;Header /&gt;
      &lt;/MuiThemeProvider&gt;
    );
    expect(container).toMatchSnapshot();
  });
  
  </code></pre>
  
  <p>But now I'd have to define the MuiThemeProvider in each of my tests.</p>
  
  <p>Is it possible to do this once for all my tests? </p>