forked from descriptinc/ffmpeg-ffprobe-static
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
26 lines (20 loc) · 757 Bytes
/
test.js
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
'use strict'
const {ok, strictEqual} = require('assert')
const {isAbsolute} = require('path')
const fs = require('fs')
const {spawnSync} = require('child_process')
const shell = require('any-shell-escape')
const ffmpegPath = require('.')
console.info('TAP version 12')
console.info('1..4')
ok(isAbsolute(ffmpegPath))
console.info('ok 1 - ffmpeg path is absolute')
ok(fs.statSync(ffmpegPath).isFile(ffmpegPath))
console.info(`ok 2 - ${ffmpegPath} is a file`)
fs.accessSync(ffmpegPath, fs.constants.X_OK)
console.info(`ok 3 - ${ffmpegPath} is executable`)
const {status} = spawnSync(ffmpegPath, ['--help'], {
stdio: ['ignore', 'ignore', 'pipe'], // stdin, stdout, stderr
})
strictEqual(status, 0)
console.info(`ok 4 - \`${ffmpegPath} --help\` works`)