11import { assertExpectError , assertInstanceOf } from "./_assertions.ts" ;
2- import { assertThrows , assertThrowsAsync , dirname } from "./dev_deps.ts" ;
2+ import {
3+ assertThrows ,
4+ assertThrowsAsync ,
5+ dirname ,
6+ fromFileUrl ,
7+ } from "./dev_deps.ts" ;
38import { Encoding } from "./encoding.ts" ;
49import { EncodingEventStream } from "./encoding_event_stream.ts" ;
510import { EncodingProcess } from "./encoding_process.ts" ;
@@ -18,7 +23,7 @@ import { EncodingErrorEvent } from "./events.ts";
1823import { ffmpeg } from "./ffmpeg.ts" ;
1924import { ffprobe } from "./ffprobe.ts" ;
2025
21- const rootDir : string = dirname ( import . meta. url ) . replace ( / ^ f i l e : \/ \/ / , "" ) ;
26+ const rootDir : string = dirname ( fromFileUrl ( import . meta. url ) ) ;
2227const inputPath = `${ rootDir } /fixtures/sample.mp4` ;
2328
2429Deno . test ( {
@@ -35,7 +40,7 @@ Deno.test({
3540 name : "ffprobe binary permission denied error" ,
3641 async fn ( ) {
3742 await assertThrowsAsync (
38- ( ) => ffprobe ( inputPath , { binary : new URL ( import . meta . url ) . pathname } ) ,
43+ ( ) => ffprobe ( inputPath , { binary : rootDir } ) ,
3944 FFprobeBinaryPermissionDenied ,
4045 ) ;
4146 } ,
@@ -65,7 +70,7 @@ Deno.test({
6570 name : "ffmpeg binary permission denied error" ,
6671 fn ( ) {
6772 const encoding = new Encoding ( ) ;
68- encoding . binary = new URL ( import . meta . url ) . pathname ;
73+ encoding . binary = rootDir ;
6974 const process = new EncodingProcess ( encoding ) ;
7075 assertThrows ( ( ) => process . run ( ) , FFmpegBinaryPermissionDenied ) ;
7176 } ,
0 commit comments