Reorder tests to prevent OOM
This commit is contained in:
parent
e6fe3d1aae
commit
9656f99e4a
@ -1,5 +1,23 @@
|
|||||||
const { createFFmpeg } = FFmpeg;
|
const { createFFmpeg } = FFmpeg;
|
||||||
|
|
||||||
|
describe('FS()', () => {
|
||||||
|
const ffmpeg = createFFmpeg(OPTIONS);
|
||||||
|
before(async function cb() {
|
||||||
|
this.timeout(0);
|
||||||
|
await ffmpeg.load();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should throw error when readdir for invalid path ', () => {
|
||||||
|
expect(() => ffmpeg.FS('readdir', '/invalid')).to.throw(/readdir/);
|
||||||
|
});
|
||||||
|
it('should throw error when readFile for invalid path ', () => {
|
||||||
|
expect(() => ffmpeg.FS('readFile', '/invalid')).to.throw(/readFile/);
|
||||||
|
});
|
||||||
|
it('should throw an default error ', () => {
|
||||||
|
expect(() => ffmpeg.FS('unlink', '/invalid')).to.throw(/Oops/);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('load()', () => {
|
describe('load()', () => {
|
||||||
it('should throw error when corePath is not a string', async () => {
|
it('should throw error when corePath is not a string', async () => {
|
||||||
const ffmpeg = createFFmpeg({ ...OPTIONS, corePath: null });
|
const ffmpeg = createFFmpeg({ ...OPTIONS, corePath: null });
|
||||||
@ -49,21 +67,3 @@ describe('run()', () => {
|
|||||||
}, 500);
|
}, 500);
|
||||||
}).timeout(TIMEOUT);
|
}).timeout(TIMEOUT);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('FS()', () => {
|
|
||||||
const ffmpeg = createFFmpeg(OPTIONS);
|
|
||||||
before(async function cb() {
|
|
||||||
this.timeout(0);
|
|
||||||
await ffmpeg.load();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should throw error when readdir for invalid path ', () => {
|
|
||||||
expect(() => ffmpeg.FS('readdir', '/invalid')).to.throw(/readdir/);
|
|
||||||
});
|
|
||||||
it('should throw error when readFile for invalid path ', () => {
|
|
||||||
expect(() => ffmpeg.FS('readFile', '/invalid')).to.throw(/readFile/);
|
|
||||||
});
|
|
||||||
it('should throw an default error ', () => {
|
|
||||||
expect(() => ffmpeg.FS('unlink', '/invalid')).to.throw(/Oops/);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
Loading…
Reference in New Issue
Block a user