gemini
Version:
UI Screenshot testing utility
20 lines (15 loc) • 502 B
JavaScript
;
const fs = require('fs-extra');
const path = require('path');
exports.copyImg = (currPath, refPath) => fs.copyAsync(currPath, refPath)
.then(() => true)
.catch(() => false);
exports.saveRef = (refPath, capture) => {
return fs.mkdirsAsync(path.dirname(refPath))
.then(() => capture.image.save(refPath))
.then(() => true)
.catch(() => false);
};
exports.existsRef = (refPath) => fs.accessAsync(refPath)
.then(() => true)
.catch(() => false);