-
Notifications
You must be signed in to change notification settings - Fork 4
/
encoding_test.ts
35 lines (29 loc) · 901 Bytes
/
encoding_test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import {
assertEquals,
dirname,
ensureDir,
exists,
fromFileUrl,
} from "./dev_deps.ts";
import { Encoding } from "./encoding.ts";
import { EncodingProcess } from "./encoding_process.ts";
const rootDir: string = dirname(fromFileUrl(import.meta.url));
const inputPath = `${rootDir}/fixtures/sample.mp4`;
Deno.test({
name: "encoding options",
async fn() {
const outputPath = `${rootDir}/.tmp/encoding options.mp4`;
await ensureDir(`${rootDir}/.tmp`);
const encoding = new Encoding();
encoding.input = inputPath;
encoding.output = outputPath;
encoding.override = true;
encoding.width = 200;
const encodingProcess = new EncodingProcess(encoding);
encodingProcess.run();
await encodingProcess.status();
encodingProcess.close();
const outputFileExists: boolean = await exists(outputPath);
assertEquals(outputFileExists, true);
},
});