Compare commits
9
Commits
images-beta-1
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b5a007194 | ||
|
|
b0162453e1 | ||
|
|
a1f09ffedc | ||
|
|
73c5b3383e | ||
|
|
5f09fb3bde | ||
|
|
0610fd6fbb | ||
|
|
22a8a206ab | ||
|
|
773249ca4f | ||
|
|
599d02ea0e |
@@ -51,7 +51,6 @@ var yellowLabTools = function(url, options) {
|
||||
|
||||
// Remove uneeded temp screenshot path
|
||||
delete data.params.options.screenshot;
|
||||
return ScreenshotHandler.deleteTmpFile(screenshotTmpPath);
|
||||
})
|
||||
|
||||
.catch(function(err) {
|
||||
|
||||
@@ -729,7 +729,7 @@ var policies = {
|
||||
"totalWeight": {
|
||||
"tool": "redownload",
|
||||
"label": "Total weight",
|
||||
"message": "<p>The weight is of course very important if you want the page to load fast. Try to stay under 1.5MB.</p>",
|
||||
"message": "<p>The weight is of course very important if you want the page to load fast. Try to stay under 1MB, which is already very long to download over a slow connection.</p>",
|
||||
"isOkThreshold": 1572864,
|
||||
"isBadThreshold": 3145728,
|
||||
"isAbnormalThreshold": 5242880,
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "yellowlabtools",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"description": "A tool that audits a webpage for performance and front-end quality issues",
|
||||
"license": "GPL-2.0",
|
||||
"author": {
|
||||
@@ -16,7 +16,7 @@
|
||||
"yellowlabtools": "./bin/cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 16.0"
|
||||
"node": ">= 18.0"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
@@ -40,10 +40,10 @@
|
||||
"md5": "2.3.0",
|
||||
"meow": "5.0.0",
|
||||
"parse-color": "1.0.0",
|
||||
"phantomas": "gmetais/phantomas#gmetais-analyze-images",
|
||||
"phantomas": "2.10.0",
|
||||
"q": "1.5.1",
|
||||
"request": "2.88.2",
|
||||
"sharp": "0.32.3",
|
||||
"sharp": "0.32.6",
|
||||
"ttf2woff2": "5.0.0",
|
||||
"uglify-js": "3.17.4",
|
||||
"woff-tools": "0.1.0"
|
||||
|
||||
@@ -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