title: Global functions in TypeScript for jest testing
body: <p>I'm using create-react-app-typescript and want to create a function that will be available in every test file similar to <a href="http://jestjs.io/docs/en/api" rel="noreferrer">jest's globals</a>.</p>
  
  <p>Is it possible to write a function in the <code>src/setupTest.ts</code> file that will be available in every test file?</p>
  
  <p>I want to write a <code>react-intl</code> helper that I can use when testing components. I have the following code:</p>
  
  <pre><code>// src/setupTests.ts
  import { createIntlWrapper } from 'test-utils/react/react-intl';
  import enMessages from './assets/locales/en.json';
  
  const wrapIntl = createIntlWrapper('en', enMessages);
  </code></pre>
  
  <p>The <code>createIntlWrapper</code> returns a function which mimic <a href="https://github.com/yahoo/react-intl/wiki/Testing-with-React-Intl#helper-function-2" rel="noreferrer">this helper function</a>.</p>
  
  <p>When I need to test components that have react-intl components, I want to be able to wrap the JSX with <code>wrapIntl(&lt;SampleComponent /&gt;)</code> without importing the code above in every file.</p>