Skip SVG test when format is unavailable

It's possible to compile *magick without SVG support
This commit is contained in:
Lovell Fuller 2015-01-25 11:34:16 +00:00
parent cda700ef73
commit 37c5ca7166

View File

@ -433,16 +433,19 @@ describe('Input/output', function() {
});
it('Convert SVG to PNG', function(done) {
it('Convert SVG, if supported, to PNG', function(done) {
sharp(fixtures.inputSvg)
.resize(100, 100)
.png()
.toFile(fixtures.path('output.svg.png'), function(err, info) {
if (err) throw err;
assert.strictEqual(true, info.size > 0);
assert.strictEqual('png', info.format);
assert.strictEqual(100, info.width);
assert.strictEqual(100, info.height);
if (err) {
assert.strictEqual('Input file is of an unsupported image format', err.message);
} else {
assert.strictEqual(true, info.size > 0);
assert.strictEqual('png', info.format);
assert.strictEqual(100, info.width);
assert.strictEqual(100, info.height);
}
done();
});
});