Commit 2c05643e authored by Fred Chasen's avatar Fred Chasen

Create Image snapshots for Mac and Linux

parent 50dbc173
Pipeline #201 passed with stage
in 6 minutes and 14 seconds
......@@ -4,10 +4,24 @@ const gs = require('ghostscript4js')
const fs = require('fs');
const rimraf = require('rimraf');
const { DEBUG } = require('./constants');
const CONFIG = {
failureThreshold: '0.01',
failureThresholdType: 'percent'
};
// const CONFIG = {
// customSnapshotsDir: `__image_snapshots_${platformToOS(process.platform)}__`
// };
function platformToOS(platform) {
let os = "";
switch (platform) {
case "darwin":
os = "mac";
break;
case "win32":
os = "windows";
break;
default:
os = "linux"
}
return os
}
function toMatchPDFSnapshot(received, page=1) {
let pdfImage;
......@@ -34,7 +48,11 @@ function toMatchPDFSnapshot(received, page=1) {
throw err
}
return toMatchImageSnapshot.apply(this, [pdfImage, CONFIG])
const config = {
customSnapshotsDir: dirname + `/__image_snapshots_${platformToOS(process.platform)}__`
};
return toMatchImageSnapshot.apply(this, [pdfImage, config])
}
export function UUID() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment