|
1 | 1 | const { createFFmpeg } = FFmpeg; |
2 | 2 |
|
| 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 | + |
3 | 21 | describe('load()', () => { |
4 | 22 | it('should throw error when corePath is not a string', async () => { |
5 | 23 | const ffmpeg = createFFmpeg({ ...OPTIONS, corePath: null }); |
@@ -49,21 +67,3 @@ describe('run()', () => { |
49 | 67 | }, 500); |
50 | 68 | }).timeout(TIMEOUT); |
51 | 69 | }); |
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