Merge branch 'develop' into webp-avif
This commit is contained in:
@@ -10,11 +10,11 @@ describe('contentTypeChecker', function() {
|
||||
var svgImageContent = fs.readFileSync(path.resolve(__dirname, '../www/svg-image.svg'));
|
||||
var cssFileContent = fs.readFileSync(path.resolve(__dirname, '../www/unminified-stylesheet.css'));
|
||||
|
||||
it('detect the right content type', async function() {
|
||||
(await contentTypeChecker.findContentType(jpgImageContent)).mimes.should.deep.equal(['image/jpeg']);
|
||||
(await contentTypeChecker.findContentType(pngImageContent)).mimes.should.deep.equal(['image/png']);
|
||||
(await contentTypeChecker.findContentType(svgImageContent)).mimes.should.deep.equal(['image/svg+xml']);
|
||||
should.equal(await contentTypeChecker.findContentType(cssFileContent), null);
|
||||
it('detect the right content type', function() {
|
||||
contentTypeChecker.findContentType(jpgImageContent).mimes.should.deep.equal(['image/jpeg']);
|
||||
contentTypeChecker.findContentType(pngImageContent).mimes.should.deep.equal(['image/png']);
|
||||
contentTypeChecker.findContentType(svgImageContent).mimes.should.deep.equal(['image/svg+xml']);
|
||||
should.equal(contentTypeChecker.findContentType(cssFileContent), null);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -160,9 +160,18 @@ describe('redownload', function() {
|
||||
redownload.redownloadEntry(entry)
|
||||
|
||||
.then(function(newEntry) {
|
||||
|
||||
newEntry.weightCheck.bodySize.should.equal(4193);
|
||||
newEntry.weightCheck.bodyBuffer.should.deep.equal(fileContent);
|
||||
done();
|
||||
|
||||
// Opening the image in jimp to check if the format is good
|
||||
var Jimp = require('jimp');
|
||||
Jimp.read(newEntry.weightCheck.bodyBuffer, function(err, image) {
|
||||
image.bitmap.width.should.equal(620);
|
||||
image.bitmap.height.should.equal(104);
|
||||
done(err);
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
.fail(function(err) {
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 36 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 82 KiB |
Reference in New Issue
Block a user