chai-image-assert

1.2.1 • Public • Published

Build Status

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');
    });
});

Package Sidebar

Install

npm i chai-image-assert

Weekly Downloads

827

Version

1.2.1

License

MIT

Unpacked Size

2.19 MB

Total Files

44

Last publish

Collaborators

  • diosmosis2