mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Linter: apply all recommended biome settings
Enforces previously-skipped useArrowFunction check
This commit is contained in:
@@ -10,7 +10,7 @@ const assert = require('node:assert');
|
||||
const fixtures = require('../fixtures');
|
||||
const sharp = require('../../');
|
||||
|
||||
describe('Boolean operation between two images', function () {
|
||||
describe('Boolean operation between two images', () => {
|
||||
const inputJpgBooleanTestBuffer = fs.readFileSync(fixtures.inputJpgBooleanTest);
|
||||
|
||||
[
|
||||
@@ -18,12 +18,12 @@ describe('Boolean operation between two images', function () {
|
||||
sharp.bool.or,
|
||||
sharp.bool.eor
|
||||
]
|
||||
.forEach(function (op) {
|
||||
it(`${op} operation, file`, function (_t, done) {
|
||||
.forEach((op) => {
|
||||
it(`${op} operation, file`, (_t, done) => {
|
||||
sharp(fixtures.inputJpg)
|
||||
.resize(320, 240)
|
||||
.boolean(fixtures.inputJpgBooleanTest, op)
|
||||
.toBuffer(function (err, data, info) {
|
||||
.toBuffer((err, data, info) => {
|
||||
if (err) throw err;
|
||||
assert.strictEqual(320, info.width);
|
||||
assert.strictEqual(240, info.height);
|
||||
@@ -31,11 +31,11 @@ describe('Boolean operation between two images', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it(`${op} operation, buffer`, function (_t, done) {
|
||||
it(`${op} operation, buffer`, (_t, done) => {
|
||||
sharp(fixtures.inputJpg)
|
||||
.resize(320, 240)
|
||||
.boolean(inputJpgBooleanTestBuffer, op)
|
||||
.toBuffer(function (err, data, info) {
|
||||
.toBuffer((err, data, info) => {
|
||||
if (err) throw err;
|
||||
assert.strictEqual(320, info.width);
|
||||
assert.strictEqual(240, info.height);
|
||||
@@ -43,15 +43,15 @@ describe('Boolean operation between two images', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it(`${op} operation, raw`, function (_t, done) {
|
||||
it(`${op} operation, raw`, (_t, done) => {
|
||||
sharp(fixtures.inputJpgBooleanTest)
|
||||
.raw()
|
||||
.toBuffer(function (err, data, info) {
|
||||
.toBuffer((err, data, info) => {
|
||||
if (err) throw err;
|
||||
sharp(fixtures.inputJpg)
|
||||
.resize(320, 240)
|
||||
.boolean(data, op, { raw: info })
|
||||
.toBuffer(function (err, data, info) {
|
||||
.toBuffer((err, data, info) => {
|
||||
if (err) throw err;
|
||||
assert.strictEqual(320, info.width);
|
||||
assert.strictEqual(240, info.height);
|
||||
@@ -61,20 +61,20 @@ describe('Boolean operation between two images', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('Invalid operation', function () {
|
||||
assert.throws(function () {
|
||||
it('Invalid operation', () => {
|
||||
assert.throws(() => {
|
||||
sharp().boolean(fixtures.inputJpgBooleanTest, 'fail');
|
||||
});
|
||||
});
|
||||
|
||||
it('Invalid operation, non-string', function () {
|
||||
assert.throws(function () {
|
||||
it('Invalid operation, non-string', () => {
|
||||
assert.throws(() => {
|
||||
sharp().boolean(fixtures.inputJpgBooleanTest, null);
|
||||
});
|
||||
});
|
||||
|
||||
it('Missing input', function () {
|
||||
assert.throws(function () {
|
||||
it('Missing input', () => {
|
||||
assert.throws(() => {
|
||||
sharp().boolean();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user