LoadImages will return nothing, only call a callback

This commit is contained in:
Chinmay Pandhare
2017-07-28 12:00:30 +05:30
parent d7eb5a2f0c
commit 7f17f825ab
6 changed files with 83 additions and 45 deletions

View File

@@ -10,11 +10,10 @@ require('../src/ImageSequencer.js');
//require image files as DataURLs so they can be tested alike on browser and Node.
var sequencer = ImageSequencer({ ui: false });
var image = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAAQABADASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAf/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAABgj/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwCdABykX//Z";
var test_png = require('../examples/test.png.js');
var test_gif = require('../examples/test.gif.js');
sequencer.loadImages(image);
sequencer.loadImages(test_png);
sequencer.addSteps(['do-nothing-pix','invert','invert']);
test("Preload", function(t) {
@@ -34,15 +33,19 @@ test("Twice inverted image is identical to original image", function (t) {
});
test("PixelManipulation works for PNG images", function (t) {
sequencer.loadImages(test_png).addSteps('invert').run(function(out){
t.equal(1,1)
t.end();
sequencer.loadImages(test_png,function(){
this.addSteps('invert').run(function(out){
t.equal(1,1)
t.end();
});
});
});
test("PixelManipulation works for GIF images", function (t) {
sequencer.loadImages(test_gif).addSteps('invert').run(function(out){
t.equal(1,1)
t.end();
sequencer.loadImages(test_gif,function(){
this.addSteps('invert').run(function(out){
t.equal(1,1)
t.end();
});
});
});