chai-image-assert
v1.2.1
Published
Image comparison chai assert (uses ImageMagick).
Downloads
2,980
Maintainers
Readme
chai-image-assert
This repo provides a chai assertion to match buffers against image files.
The assert uses ImageMagick's compare
tool.
Usage
var fs = require('fs');
var path = require('path');
var chai = require('chai');
chai.use(require('chai-image-assert')(__dirname));
describe("my test", function () {
it("should match", function () {
var myFile = fs.readFileSync(path.join("path-to-my-file.png"));
expect(myFile).to.matchImage('name-in-expected');
});
});