diff --git a/test/processImage.js b/test/processImage.js index db08b5c..c9e2241 100644 --- a/test/processImage.js +++ b/test/processImage.js @@ -33,6 +33,12 @@ describe('express-processimage', function () { response: value } ); + }) + .addAssertion(' [when] converted to PNG ', function (expect, subject) { + expect.errorMode = 'bubble'; + return sharp(subject).png().toBuffer().then(function (pngBuffer) { + return expect.shift(pngBuffer); + }); }); it('should not mess with request for non-image file', function () { @@ -739,7 +745,7 @@ describe('express-processimage', function () { height: 48 } }) - .and('to resemble', pathModule.resolve(__dirname, '..', 'testdata', 'rotatedBulb.gif')) + .and('when converted to PNG to resemble', pathModule.resolve(__dirname, '..', 'testdata', 'rotatedBulb.png')) }); }); @@ -756,7 +762,7 @@ describe('express-processimage', function () { }, Interlace: 'Line' }) - .and('to resemble', pathModule.resolve(__dirname, '..', 'testdata', 'rotatedBulb.gif')) + .and('when converted to PNG to resemble', pathModule.resolve(__dirname, '..', 'testdata', 'rotatedBulb.png')) }); }); }); diff --git a/testdata/rotatedBulb.png b/testdata/rotatedBulb.png new file mode 100644 index 0000000..0488aef Binary files /dev/null and b/testdata/rotatedBulb.png differ