title: Moxios - TypeError: Cannot read property 'adapter' of undefined
body: <p>Trying to test <code>axios</code> calls and trying the <code>moxios</code> package.</p>
  
  <p><code>"axios": "^0.16.2",</code>
  <code>"moxios": "^0.4.0",</code></p>
  
  <p>Found here: <a href="https://github.com/axios/moxios" rel="nofollow noreferrer">https://github.com/axios/moxios</a></p>
  
  <p>Following there example, but my test errors out on the <code>moxios.install()</code> line:</p>
  
  <pre><code>import axios from 'axios'
  import moxios from 'moxios'
  import sinon from 'sinon'
  import { equal } from 'assert'
  
  describe('mocking axios requests', function () {
  
    describe('across entire suite', function () {
  
      beforeEach(function () {
        // import and pass your custom axios instance to this method
        moxios.install()
      })
  </code></pre>
  
  <h2>My actual test</h2>
  
  <pre><code>import axios from 'axios';
  import moxios from 'moxios';
  import sinon from 'sinon';
  import { equal } from 'assert';
  
  const akamaiData = {
    name: 'akamai'
  };
  
  describe('mocking axios requests', () =&gt; {
    describe('across entire suite', () =&gt; {
      beforeEach(() =&gt; {
        // import and pass your custom axios instance to this method
        moxios.install();
      });
  
      afterEach(() =&gt; {
        // import and pass your custom axios instance to this method
        moxios.uninstall();
      });
  
      it('should stub requests', (done) =&gt; {
        moxios.stubRequest('/akamai', {
          status: 200,
          response: {
            name: 'akamai'
          }
        });
  
        // const onFulfilled = sinon.spy();
        // axios.get('/akamai').then(onFulfilled);
        //
        // moxios.wait(() =&gt; {
        //   equal(onFulfilled.getCall(0).args[0], akamaiData);
        //   done();
        // });
      });
    });
  });
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/xKsWw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xKsWw.png" alt="enter image description here"></a></p>
  
  <p>I did find this closed issue here, however the fix "passing <code>axios</code> into the <code>moxios.install(axios)</code> function did not work"</p>
  
  <p><a href="https://github.com/axios/moxios/issues/15" rel="nofollow noreferrer">https://github.com/axios/moxios/issues/15</a></p>