Update tests to meet semistandard code standards

Switch to const/let instead of var
This commit is contained in:
Lovell Fuller
2016-10-26 11:52:45 +01:00
parent 36e636dca1
commit cbdbbe535a
38 changed files with 1378 additions and 1405 deletions

View File

@@ -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();
});
});