Test code refactor #63

Use mocha for feature-specific unit tests

Add test coverage report via istanbul
This commit is contained in:
Lovell Fuller
2014-10-20 15:32:56 +01:00
parent f4cb577cb4
commit ca561daedf
37 changed files with 1341 additions and 1223 deletions

26
test/unit/gamma.js Executable file
View File

@@ -0,0 +1,26 @@
'use strict';
var sharp = require('../../index');
var fixtures = require('../fixtures');
describe('Gamma correction', function() {
it('value of 0.0 (disabled)', function(done) {
sharp(fixtures.inputJpgWithGammaHoliness)
.resize(129, 111)
.toFile(fixtures.path('output.gamma-0.0.jpg'), done);
});
it('value of 2.2 (default)', function(done) {
sharp(fixtures.inputJpgWithGammaHoliness)
.resize(129, 111)
.gamma()
.toFile(fixtures.path('output.gamma-2.2.jpg'), done);
});
it('value of 3.0', function(done) {
sharp(fixtures.inputJpgWithGammaHoliness)
.resize(129, 111)
.gamma(3)
.toFile(fixtures.path('output.gamma-3.0.jpg'), done);
});
});