fix: Cancel run promise if the exit() is called

This commit is contained in:
Carlos Rodrigues
2022-01-06 12:15:15 +00:00
parent fcc312abd3
commit 6f17936d95
2 changed files with 18 additions and 1 deletions

View File

@@ -48,6 +48,16 @@ describe('run()', () => {
}
}, 500);
}).timeout(TIMEOUT);
it('should terminate the run if exit is called', async () => {
const ffmpeg = createFFmpeg(OPTIONS);
await ffmpeg.load();
ffmpeg.run('-h').catch(e=> {
expect(e).to.be.equal('ffmpeg has exited')
});
expect(ffmpeg.exit()).to.throw();
}).timeout(TIMEOUT);
});
describe('FS()', () => {