test: fix filepath unit tests & add

This commit is contained in:
Jelle Glebbeek
2021-08-28 02:41:33 +02:00
parent 3afb5f1062
commit ad71993e2a

View File

@@ -128,6 +128,17 @@ describe('create portable folder', () => {
});
});
describe('checkFfmpeg', () => {
it('should do nothing when ffmpeg exists', () => {
const instance = instanceBuilder(true);
instance.ffmpeg = "ffmpeg/path";
fs.copyFileSync = jest.fn();
fs.promises.access = jest.fn().mockResolvedValue(true);
instance.checkFfmpeg();
expect(fs.copyFileSync).toBeCalledTimes(0);
});
});
function instanceBuilder(packaged, portable) {