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');
22const { log } = require ( '../utils/log' ) ;
33
44module . exports = async ( { corePath : _corePath } ) => {
5+ if ( typeof _corePath !== 'string' ) {
6+ throw Error ( 'corePath should be a string!' ) ;
7+ }
58 if ( typeof window . createFFmpegCore === 'undefined' ) {
69 log ( 'info' , 'fetch ffmpeg-core.worker.js script' ) ;
710 const corePath = resolveURL ( _corePath ) ;
Original file line number Diff line number Diff line change 11const { createFFmpeg } = FFmpeg ;
22
33describe ( '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+ } ) ;
413 it ( 'should throw error when not called before FS() and run()' , ( ) => {
514 const ffmpeg = createFFmpeg ( OPTIONS ) ;
615 expect ( ( ) => ffmpeg . FS ( 'readdir' , 'dummy' ) ) . to . throw ( ) ;
You can’t perform that action at this time.
0 commit comments