title: vue3 vitest mock axios can't read 'then'
body: <p>I have the function in the Races.vue file, the front end is working fine but not testing</p>
  <pre><code>getRaces: function () {
    axios.get(URL)
        .then(response =&gt; {
          console.log(response)
        })
        .catch(error =&gt; {
          console.log(error);
          this.errored = true;
        })
        .finally(() =&gt; {
          this.loading = false;
        })
  }
  </code></pre>
  <p>And when I try to test it, after adding vi.mock part, will give &quot;TypeError: Cannot read properties of undefined (reading 'then')&quot; error</p>
  <pre><code>import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'
  import { shallowMount, mount, flushPromises } from '@vue/test-utils'
  import Races from '../Races.vue'
  import axios from 'axios'
  
  vi.mock(&quot;axios&quot;, () =&gt; {
    return {
      default: {
        get: vi.fn(),
      },
    };
  });
  </code></pre>
  <p>Any idea on how to solve this? Thank you so much</p>