0.3.0 • Published 6 years ago
webjerk-image-set-diff v0.3.0
webjerk-image-set-diff
compares two sets of images.
provide it folders, refDir
& runDir
, where both folders contain png
files. images are compared by basename. that is, /refDir/test-image.png
would be compared to /runDir/test-image.png
.
the comparisons use blink-diff to compare images.
usage
var ImageSetDiffer = require('webjerk-image-set-diff')
var refDir = '/reference-images'
var runDir = '/test-run-images'
var idr = new ImageSetDiffer({
refDir,
runDir,
report: true, // generate a report?
allowNewImages: true, // allow new images into the ref set
approveChanges: false // appove run images as new refs. migrate run/ images to ref/
})
var diffs = await idr.run() // blinkDifference objects
when mismatches are detected, ImageSetDiffer::run
throws.
err.code
will equal'EIMAGEDIFFS'
err.differences
will have an array of blink difference data attached to the failing image
console.log(err.differences)
// => [{ basename, blinkDiff, message }, ..., for, each, image, mismatch]
config
some settings may be set from the env:
WEBJERK_ALLOW_NEW_IMAGES
, set to allow new images not found in the reference setWEBJERK_APPROVE_CHANGES
, set to approve all image changes
0.3.0
6 years ago
0.2.24
6 years ago
0.2.23
6 years ago
0.2.22
6 years ago
0.2.21
6 years ago
0.2.19
6 years ago
0.2.17
6 years ago
0.2.16
6 years ago
0.2.15
6 years ago
0.2.14
6 years ago
0.2.13
6 years ago
0.2.12
6 years ago
0.2.10
6 years ago
0.2.9
6 years ago
0.2.8
6 years ago
0.2.4
6 years ago
0.2.3
6 years ago
0.2.2
6 years ago
0.2.0
7 years ago
0.1.0
7 years ago
0.0.5
7 years ago
0.0.4
7 years ago
0.0.3
7 years ago