mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Update tests to meet semistandard code standards
Switch to const/let instead of var
This commit is contained in:
@@ -1,22 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
var assert = require('assert');
|
||||
var fixtures = require('../fixtures');
|
||||
var sharp = require('../../index');
|
||||
|
||||
describe('Bandbool per-channel boolean operations', function() {
|
||||
const assert = require('assert');
|
||||
const fixtures = require('../fixtures');
|
||||
const sharp = require('../../index');
|
||||
|
||||
describe('Bandbool per-channel boolean operations', function () {
|
||||
[
|
||||
sharp.bool.and,
|
||||
sharp.bool.or,
|
||||
sharp.bool.eor
|
||||
]
|
||||
.forEach(function(op) {
|
||||
it(op + ' operation', function(done) {
|
||||
.forEach(function (op) {
|
||||
it(op + ' operation', function (done) {
|
||||
sharp(fixtures.inputPngBooleanNoAlpha)
|
||||
.bandbool(op)
|
||||
.toColourspace('b-w')
|
||||
.toBuffer(function(err, data, info) {
|
||||
.toBuffer(function (err, data, info) {
|
||||
if (err) throw err;
|
||||
assert.strictEqual(200, info.width);
|
||||
assert.strictEqual(200, info.height);
|
||||
@@ -26,23 +25,24 @@ describe('Bandbool per-channel boolean operations', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('sRGB image retains 3 channels', function(done) {
|
||||
it('sRGB image retains 3 channels', function (done) {
|
||||
sharp(fixtures.inputJpg)
|
||||
.bandbool('and')
|
||||
.toBuffer(function(err, data, info) {
|
||||
.toBuffer(function (err, data, info) {
|
||||
if (err) throw err;
|
||||
assert.strictEqual(3, info.channels);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('Invalid operation', function() {
|
||||
assert.throws(function() {
|
||||
it('Invalid operation', function () {
|
||||
assert.throws(function () {
|
||||
sharp().bandbool('fail');
|
||||
});
|
||||
});
|
||||
|
||||
it('Missing operation', function() {
|
||||
assert.throws(function() {
|
||||
it('Missing operation', function () {
|
||||
assert.throws(function () {
|
||||
sharp().bandbool();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user