@@ -349,7 +349,7 @@ describe(`fetch-remote-file`, () => {
349349 expect ( gotStream ) . toBeCalledTimes ( 1 )
350350 } )
351351
352- it ( `downloads and create a jpg file for file with non-ascii filename ` , async ( ) => {
352+ it ( `downloads and create a jpg file for file with non-ascii url ` , async ( ) => {
353353 const filePath = await fetchRemoteFile ( {
354354 url : `http://external.com/${ encodeURIComponent ( `개` ) } .jpg` ,
355355 cache,
@@ -362,6 +362,20 @@ describe(`fetch-remote-file`, () => {
362362 expect ( gotStream ) . toBeCalledTimes ( 1 )
363363 } )
364364
365+ it ( `downloads and create a jpg file for file with non-ascii filename` , async ( ) => {
366+ const filePath = await fetchRemoteFile ( {
367+ url : `http://external.com/dog.jpg` ,
368+ name : `${ encodeURIComponent ( `개` ) } .jpg` ,
369+ cache,
370+ } )
371+
372+ expect ( path . basename ( filePath ) ) . toBe ( `개.jpg` )
373+ expect ( getFileSize ( filePath ) ) . resolves . toBe (
374+ await getFileSize ( path . join ( __dirname , `./fixtures/dog-thumbnail.jpg` ) )
375+ )
376+ expect ( gotStream ) . toBeCalledTimes ( 1 )
377+ } )
378+
365379 it ( `downloads and create a jpg file for unknown extension` , async ( ) => {
366380 const filePath = await fetchRemoteFile ( {
367381 url : `http://external.com/dog` ,
0 commit comments