I am trying to unit test the following module, but getting the below error. Can someone please share any ideas on how to mock `axios.CancelToken()` here? or How test this part?

service.js

```
let myCancelToken
export async function myTestFuncService (name) {
  if (myCancelToken) {
    myCancelToken.cancel()
  }
  myCancelToken = axios.CancelToken.source()
  try {
    return axios.get(`mypath/${name}`, {
      cancelToken: myCancelToken.token
    })
  } catch (e) {
    return e
  }
}

```

service.test.js

```
import * as myModule from './service.js'
import axios from 'axios'
jest.mock('axios')

it('test myTestFuncService', async () => {
    const testData = {
      data: {
        response: 'some test data'
      }
    }
    axios.get.mockImplementationOnce(() => Promise.resolve(testData))
    await expect(
      myModule.myTestFuncService('ABC')
    ).resolves.toBe(testData)
  })

```

Error:

```
TypeError: Cannot set property 'cancel' of undefined

```