-
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathtest.js
More file actions
35 lines (26 loc) · 691 Bytes
/
test.js
File metadata and controls
35 lines (26 loc) · 691 Bytes
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
const test = require('ava');
const verifyFile = require('./lib/verify-file.js');
const main = async () => {
const {execa} = await import('execa');
const executable = require('executable');
const m = require('./index.js');
test('returns path', t => {
t.truthy(m.path);
});
test('returns version', t => {
t.truthy(m.version);
});
test('spawns', async t => {
const result = await execa(m.path, ['-version']);
t.falsy(result.stderr);
t.regex(result.stdout, /ffprobe version/g);
});
test('is executable', async t => {
t.truthy(await executable(m.path));
});
test('verifies file', t => {
t.true(verifyFile(m.path));
t.falsy(verifyFile('foo'));
});
};
main();