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) sharp(fixtures.inputSvg)
.resize(100, 100) .resize(100, 100)
.png() .png()
.toFile(fixtures.path('output.svg.png'), function(err, info) { .toFile(fixtures.path('output.svg.png'), function(err, info) {
if (err) throw err; if (err) {
assert.strictEqual('Input file is of an unsupported image format', err.message);
} else {
assert.strictEqual(true, info.size > 0); assert.strictEqual(true, info.size > 0);
assert.strictEqual('png', info.format); assert.strictEqual('png', info.format);
assert.strictEqual(100, info.width); assert.strictEqual(100, info.width);
assert.strictEqual(100, info.height); assert.strictEqual(100, info.height);
}
done(); done();
}); });
}); });