Better validation and test coverage for background colours

This commit is contained in:
Lovell Fuller
2019-08-16 20:37:17 +01:00
parent e4333ff6b0
commit da4e05c118
6 changed files with 33 additions and 16 deletions

View File

@@ -81,6 +81,18 @@ describe('Alpha transparency', function () {
});
});
it('Flatten with options but without colour does not throw', () => {
assert.doesNotThrow(() => {
sharp().flatten({});
});
});
it('Flatten to invalid colour throws', () => {
assert.throws(() => {
sharp().flatten({ background: 1 });
});
});
it('Enlargement with non-nearest neighbor interpolation shouldnt cause dark edges', function () {
const base = 'alpha-premultiply-enlargement-2048x1536-paper.png';
const actual = fixtures.path('output.' + base);