mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Skip SVG test when format is unavailable
It's possible to compile *magick without SVG support
This commit is contained in:
parent
cda700ef73
commit
37c5ca7166
@ -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();
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user