Created
June 17, 2014 21:20
-
-
Save deyceg/8234b68b1c5ea910258b to your computer and use it in GitHub Desktop.
imagediff node-canvas browserify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it("should parse cpl character printing command and render correctly in canvas", function(done) { | |
//fs is shimmed by browserify | |
var buff = fs.readFileSync(__dirname + '/../fixtures/helloworld.png'); | |
/* | |
node-canvas impl exports Canvas.Image constructor function | |
browserify canvas shim does not support Canvas.Image | |
*/ | |
var expected = new Canvas.Image(); | |
expected.src = buff; | |
//cpl is the parser instance | |
var ctx = cpl.render("111100000000000Hello World!"); //This is some CPL!!! | |
expect(imagediff.equal(expected, ctx, 30)).to.be.true; //TODO Review tolerance | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment