title: TypeError: Cannot read property 'apply' of undefined
body: <p>Can't testing a react component. Below I put code of my setup.js - my configure file and text of error. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>require('babel-register')();
  
  var jsdom = require('jsdom').jsdom;
  
  var exposedProperties = ['window', 'navigator', 'document'];
  
  global.document = jsdom('');
  global.window = document.defaultView;
  Object.keys(document.defaultView).forEach((property) =&gt; {
    if (typeof global[property] === 'undefined') {
      exposedProperties.push(property);
      global[property] = document.defaultView[property];
    }
  });
  
  global.navigator = {
    userAgent: 'node.js'
  };
  //
  var documentRef = document;
  
  //
  process.env.NODE_ENV = 'test';
  
  function noop() {
    return null;
  }
  
  require.extensions['.css'] = noop;
  require.extensions['.scss'] = noop;
  require.extensions['.md'] = noop;
  require.extensions['.png'] = noop;
  require.extensions['.svg'] = noop;
  require.extensions['.jpg'] = noop;
  require.extensions['.jpeg'] = noop;
  require.extensions['.gif'] = noop;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Test code. This is very simple test and it fails.(</p>
  
  <p>Editing. My component code is below.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React from 'react';
  import {mount, shallow} from 'enzyme';
  import {expect} from 'chai';
  
  import Header from '../../src/components/Header';
  
  
  
  describe ('&lt;Header /&gt;', () =&gt; {
    it('should have a logo image', function() {
      const wrapper = mount(&lt;Header /&gt;);
      expect(wrapper.find('img')).to.have.length(1);
    });
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>at WithStyles.componentWillMount (node_modules\isomorphic-style-loader\lib\withStyles.j
   at node_modules\react-dom\lib\ReactCompositeComponent.js:348:23
   at measureLifeCyclePerf (node_modules\react-dom\lib\ReactCompositeComponent.js:75:12)</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class Header extends React.Component {
    static propTypes = {
      intl: intlShape.isRequired,
    };
  
    componentDidMount() {
      this.searchbox.refs.queryField.focus();
    }
  
    render() {
      return (
        &lt;div className={s.root}&gt;
          &lt;div className={s.container}&gt;
            &lt;img className={s.alphaRibbon} src={alphaRibbon} alt="alpha" width="50px" /&gt;
            &lt;Link className={s.brand} to="/"&gt;
              &lt;img src={logoUrl2x} srcSet={`${logoUrl2x} 2x`} width="67" height="38" alt="8kolo" /&gt;
              &lt;span className={s.brandTxt}&gt;
                &lt;FormattedMessage {...messages.brand} /&gt;
              &lt;/span&gt;
            &lt;/Link&gt;
            &lt;Navigation className={s.nav} /&gt;
            &lt;div className={s.search}&gt;
              &lt;SearchBoxRedirect
                ref={sb =&gt; { this.searchbox = sb; }}
                hitsRoute="/"
                searchOnChange
                placeholder={this.props.intl.formatMessage(messages.searchPlaceholder)}
                prefixQueryFields={['full_name']}
              /&gt;
            &lt;/div&gt;
            {/* &lt;LanguageSwitcher /&gt; */}
          &lt;/div&gt;
          {/* &lt;div className={s.banner}&gt;
            &lt;div className={s.container}&gt;
              &lt;FormattedMessage tagName="p" {...messages.bannerDesc} /&gt;
            &lt;/div&gt;
          &lt;/div&gt;*/}
        &lt;/div&gt;
      );
    }
  }
  
  export default withStyles(s)(injectIntl(Header));</code></pre>
  </div>
  </div>
  </p>