typescript – Refactor implementation or mock all


I have the following code which downloads a zip, unpacks & parses the result:

export default class DataService {
  #url: string = 'http://domain/download/file.zip';

  @memoize
  async getPlayers(): Promise<Player()> {
    const response = await axios.get(this.#url, { responseType: 'arraybuffer' });
    const zip = new AdmZip(response.data);
    const zipEntries = zip.getEntries();
    const xml = zipEntries(0).getData().toString();
    const {
      playerslist: { player },
    }: PlayersList = parser.parse(xml);
    return player;
  }
}

I want to write a test for this using Jest but in a place where I am heavily mocking the third party libraries:

import { mocked } from 'ts-jest/utils';
import DataService from './DataService';
import axios from 'axios';
import * as AdmZip from 'adm-zip';
import * as parser from 'fast-xml-parser';

const MockedData = {
    playerslist: {
        player: (
            {
                id: 1,
                name: 'player 1',
                rating: 1000
            }
        )
    },
};
jest.mock('axios', () => {
    return {
        get: jest.fn().mockImplementation(() => Promise.resolve({ data: 'file.zip'}))
    }
});
jest.mock('AdmZip', () => {
    return {
        getEntries: jest.fn().mockImplementation(() => {
            return (
                {
                    entryName: 'file.xml',
                    getData: jest.fn().mockImplementation(() => '')
                }
            )
        })
    }
});
jest.mock('parser', () => {
    return {
        parser: jest.fn().mockImplementation(() => MockedData)
    }
});


describe('getPlayers', () => {

    beforeEach(() => {
        axios.mockClear();
      });
      
    const MockedAxios = mocked(axios, true);

    it('successfully fetches data', async () => {

        const dataService = new DataService();
        const players = await dataService.getPlayers();

        // ideally what I would like to test:
        expect(players).toBe(MockedData);
    });
});

What is the best approach here, should I continue to mock those dependencies?