parent
ed4be10ae3
commit
37cc9f567d
@ -687,7 +687,7 @@ class Page extends EventEmitter {
|
||||
console.assert(options.type === 'png' || options.type === 'jpeg', 'Unknown options.type value: ' + options.type);
|
||||
screenshotType = options.type;
|
||||
} else if (options.path) {
|
||||
const mimeType = mime.lookup(options.path);
|
||||
const mimeType = mime.getType(options.path);
|
||||
if (mimeType === 'image/png')
|
||||
screenshotType = 'png';
|
||||
else if (mimeType === 'image/jpeg')
|
||||
|
@ -26,10 +26,10 @@
|
||||
"author": "The Chromium Authors",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"debug": "^2.6.8",
|
||||
"debug": "^3.1.0",
|
||||
"extract-zip": "^1.6.5",
|
||||
"https-proxy-agent": "^2.1.0",
|
||||
"mime": "^1.3.4",
|
||||
"mime": "^2.0.3",
|
||||
"progress": "^2.0.0",
|
||||
"proxy-from-env": "^1.0.0",
|
||||
"rimraf": "^2.6.1",
|
||||
@ -41,7 +41,7 @@
|
||||
"devDependencies": {
|
||||
"@types/debug": "0.0.30",
|
||||
"@types/extract-zip": "^1.6.2",
|
||||
"@types/mime": "^1.3.1",
|
||||
"@types/mime": "^2.0.0",
|
||||
"@types/node": "^8.0.26",
|
||||
"@types/rimraf": "^2.0.2",
|
||||
"@types/ws": "^3.0.2",
|
||||
|
@ -93,11 +93,11 @@ function compare(goldenPath, outputPath, actual, goldenName) {
|
||||
};
|
||||
}
|
||||
const expected = fs.readFileSync(expectedPath);
|
||||
const comparator = GoldenComparators[mime.lookup(goldenName)];
|
||||
const comparator = GoldenComparators[mime.getType(goldenName)];
|
||||
if (!comparator) {
|
||||
return {
|
||||
pass: false,
|
||||
message: 'Failed to find comparator with type ' + mime.lookup(goldenName) + ': ' + goldenName
|
||||
message: 'Failed to find comparator with type ' + mime.getType(goldenName) + ': ' + goldenName
|
||||
};
|
||||
}
|
||||
const result = comparator(actual, expected);
|
||||
|
@ -234,7 +234,7 @@ class SimpleServer {
|
||||
response.end(`File not found: ${filePath}`);
|
||||
return;
|
||||
}
|
||||
response.setHeader('Content-Type', mime.lookup(filePath));
|
||||
response.setHeader('Content-Type', mime.getType(filePath));
|
||||
response.end(data);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user