Skip to content

Commit 101700f

Browse files
committed
Reorder tests to prevent OOM
1 parent acc7976 commit 101700f

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

tests/ffmpeg.test.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
const { createFFmpeg } = FFmpeg;
22

3+
describe('FS()', () => {
4+
const ffmpeg = createFFmpeg(OPTIONS);
5+
before(async function cb() {
6+
this.timeout(0);
7+
await ffmpeg.load();
8+
});
9+
10+
it('should throw error when readdir for invalid path ', () => {
11+
expect(() => ffmpeg.FS('readdir', '/invalid')).to.throw(/readdir/);
12+
});
13+
it('should throw error when readFile for invalid path ', () => {
14+
expect(() => ffmpeg.FS('readFile', '/invalid')).to.throw(/readFile/);
15+
});
16+
it('should throw an default error ', () => {
17+
expect(() => ffmpeg.FS('unlink', '/invalid')).to.throw(/Oops/);
18+
});
19+
});
20+
321
describe('load()', () => {
422
it('should throw error when corePath is not a string', async () => {
523
const ffmpeg = createFFmpeg({ ...OPTIONS, corePath: null });
@@ -49,21 +67,3 @@ describe('run()', () => {
4967
}, 500);
5068
}).timeout(TIMEOUT);
5169
});
52-
53-
describe('FS()', () => {
54-
const ffmpeg = createFFmpeg(OPTIONS);
55-
before(async function cb() {
56-
this.timeout(0);
57-
await ffmpeg.load();
58-
});
59-
60-
it('should throw error when readdir for invalid path ', () => {
61-
expect(() => ffmpeg.FS('readdir', '/invalid')).to.throw(/readdir/);
62-
});
63-
it('should throw error when readFile for invalid path ', () => {
64-
expect(() => ffmpeg.FS('readFile', '/invalid')).to.throw(/readFile/);
65-
});
66-
it('should throw an default error ', () => {
67-
expect(() => ffmpeg.FS('unlink', '/invalid')).to.throw(/Oops/);
68-
});
69-
});

0 commit comments

Comments
 (0)