Skip to content

Commit

Permalink
Added missing tests for available encoders
Browse files Browse the repository at this point in the history
  • Loading branch information
rhodgkins committed Apr 23, 2017
1 parent 63b603d commit 119a277
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion test/capabilities.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ describe('Capabilities', function() {
});
});

it('should enable checking command arguments for available codecs and formats', function(done) {
it('should enable checking command arguments for available codecs, formats and encoders', function(done) {
async.waterfall([
// Check with everything available
function(cb) {
Expand Down Expand Up @@ -196,6 +196,38 @@ describe('Capabilities', function() {
assert.ok(!!err);
err.message.should.match(/Video codec invalid-video-codec is not available/);

cb();
});
},

// Invalid audio encoder
function(cb) {
new Ffmpeg('/path/to/file.avi')
.fromFormat('avi')
// Valid codec, but not a valid encoder for audio
.audioCodec('png')
.videoCodec('png')
.toFormat('mp4')
._checkCapabilities(function(err) {
assert.ok(!!err);
err.message.should.match(/Audio codec png is not available/);

cb();
});
},

// Invalid video encoder
function(cb) {
new Ffmpeg('/path/to/file.avi')
.fromFormat('avi')
.audioCodec('pcm_u16le')
// Valid codec, but not a valid encoder for video
.videoCodec('pcm_u16le')
.toFormat('mp4')
._checkCapabilities(function(err) {
assert.ok(!!err);
err.message.should.match(/Video codec pcm_u16le is not available/);

cb();
});
}
Expand Down

0 comments on commit 119a277

Please sign in to comment.