mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Tests: allow range for text image dimensions
This commit is contained in:
parent
0bd1715f36
commit
d206fd5392
@ -7,6 +7,7 @@ const assert = require('assert');
|
|||||||
|
|
||||||
const sharp = require('../../');
|
const sharp = require('../../');
|
||||||
const fixtures = require('../fixtures');
|
const fixtures = require('../fixtures');
|
||||||
|
const { inRange } = require('../../lib/is');
|
||||||
|
|
||||||
describe('Text to image', function () {
|
describe('Text to image', function () {
|
||||||
this.retries(3);
|
this.retries(3);
|
||||||
@ -59,8 +60,8 @@ describe('Text to image', function () {
|
|||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
assert.strictEqual('png', info.format);
|
assert.strictEqual('png', info.format);
|
||||||
assert.strictEqual(3, info.channels);
|
assert.strictEqual(3, info.channels);
|
||||||
assert.ok(info.width <= maxWidth, `Actual width ${info.width}`);
|
assert.ok(inRange(info.width, 1, maxWidth + 5), `Actual width ${info.width}`);
|
||||||
assert.ok(info.height <= maxHeight, `Actual height ${info.height}`);
|
assert.ok(inRange(info.height, 1, maxHeight + 5), `Actual height ${info.height}`);
|
||||||
assert.ok(info.textAutofitDpi > 0);
|
assert.ok(info.textAutofitDpi > 0);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user