test: explicitly set platform to use in test

This commit is contained in:
Jelle Glebbeek
2021-10-18 21:18:14 +02:00
parent cc92611ad2
commit 87dc2e1f36

View File

@@ -55,10 +55,12 @@ describe('getRemoteVersion', () => {
});
});
it('returns object with the links and the version', async () => {
const axiosGetSpy = jest.spyOn(axios, 'get').mockReturnValue({
status: 200,
const axiosGetSpy = jest.spyOn(axios, 'get').mockResolvedValue({
data: { version: "4.2.1", bin: { "windows-32": { ffmpeg: "ffmpeg/link", ffprobe: "ffprobe/link" } } },
});
Object.defineProperty(process, "platform", {
value: "win32"
});
const instance = new FfmpegUpdater({platform: "win32"});
const result = await instance.getRemoteVersion();
expect(result).toEqual({