Skip to content

Commit

Permalink
Add test coverage for single value extend operation
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Jul 26, 2019
1 parent 6cf0b32 commit 50b4610
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Binary file added test/fixtures/expected/extend-equal-single.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions test/unit/extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ const sharp = require('../../');
const fixtures = require('../fixtures');

describe('Extend', function () {
it('extend all sides equally via a single value', function (done) {
sharp(fixtures.inputJpg)
.resize(120)
.extend(10)
.toBuffer(function (err, data, info) {
if (err) throw err;
assert.strictEqual(140, info.width);
assert.strictEqual(118, info.height);
fixtures.assertSimilar(fixtures.expected('extend-equal-single.jpg'), data, done);
});
});

it('extend all sides equally with RGB', function (done) {
sharp(fixtures.inputJpg)
.resize(120)
Expand Down

0 comments on commit 50b4610

Please sign in to comment.