File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ const resolveURL = require('resolve-url');
2
2
const { log } = require ( '../utils/log' ) ;
3
3
4
4
module . exports = async ( { corePath : _corePath } ) => {
5
+ if ( typeof _corePath !== 'string' ) {
6
+ throw Error ( 'corePath should be a string!' ) ;
7
+ }
5
8
if ( typeof window . createFFmpegCore === 'undefined' ) {
6
9
log ( 'info' , 'fetch ffmpeg-core.worker.js script' ) ;
7
10
const corePath = resolveURL ( _corePath ) ;
Original file line number Diff line number Diff line change 1
1
const { createFFmpeg } = FFmpeg ;
2
2
3
3
describe ( 'load()' , ( ) => {
4
+ it ( 'should throw error when corePath is not a string' , async ( ) => {
5
+ const ffmpeg = createFFmpeg ( { ...OPTIONS , corePath : null } ) ;
6
+
7
+ try {
8
+ await ffmpeg . load ( ) ;
9
+ } catch ( e ) {
10
+ expect ( e ) . to . be . an ( 'Error' ) ;
11
+ }
12
+ } ) ;
4
13
it ( 'should throw error when not called before FS() and run()' , ( ) => {
5
14
const ffmpeg = createFFmpeg ( OPTIONS ) ;
6
15
expect ( ( ) => ffmpeg . FS ( 'readdir' , 'dummy' ) ) . to . throw ( ) ;
You can’t perform that action at this time.
0 commit comments