Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit 085c417

Browse files
author
Hans Kristian Flaatten
committed
Add test for version aspect crop command
1 parent 73805aa commit 085c417

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,21 @@ describe('resize.cmdVersion()', function() {
201201

202202
assert.equal(cmd, out);
203203
});
204+
205+
it('sets crop if aspect ratio is defined', function() {
206+
version.aspect = '4:3';
207+
208+
var cmd = resize.cmdVersion(image, version);
209+
var out = [
210+
'mpr:./a.jpg',
211+
'-crop "1334x1000+333+0"',
212+
'-resize "500x500"',
213+
'-write a-b.jpg',
214+
'+delete'
215+
].join(' ');
216+
217+
assert.equal(cmd, out);
218+
});
204219
});
205220

206221
describe('resize()', function() {

0 commit comments

Comments
 (0)