mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-18 14:20:06 +01:00
add basic test and remove some bugs (#271)
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
This commit is contained in:
committed by
Jeffrey Warren
parent
8d3ca0887f
commit
be810fb9c4
5
dist/image-sequencer.js
vendored
5
dist/image-sequencer.js
vendored
@@ -47913,7 +47913,7 @@ function Run(ref, json_q, callback, progressObj) {
|
||||
function drawStep(drawarray, pos) {
|
||||
if (pos == drawarray.length && drawarray[pos - 1] !== undefined) {
|
||||
var image = drawarray[pos - 1].image;
|
||||
if (ref.objTypeOf(callback) == "Function") {
|
||||
if (ref.objTypeOf(callback) == "Function" && ref.images[image].steps.slice(-1)[0].output) {
|
||||
var steps = ref.images[image].steps;
|
||||
var out = steps[steps.length - 1].output.src;
|
||||
callback(out);
|
||||
@@ -49668,9 +49668,6 @@ module.exports = function Invert(options, UI) {
|
||||
// The function which is called on every draw.
|
||||
function draw(input, callback, progressObj) {
|
||||
|
||||
console.log(this.getIndex());
|
||||
console.log(this.getPreviousStep().options.name);
|
||||
console.log(this.getStep(0).options.name);
|
||||
progressObj.stop(true);
|
||||
progressObj.overrideFlag = true;
|
||||
// Tell UI that a step is being drawn.
|
||||
|
||||
2
dist/image-sequencer.min.js
vendored
2
dist/image-sequencer.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -6,7 +6,7 @@ function Run(ref, json_q, callback, progressObj) {
|
||||
function drawStep(drawarray, pos) {
|
||||
if (pos == drawarray.length && drawarray[pos - 1] !== undefined) {
|
||||
var image = drawarray[pos - 1].image;
|
||||
if (ref.objTypeOf(callback) == "Function") {
|
||||
if (ref.objTypeOf(callback) == "Function" && ref.images[image].steps.slice(-1)[0].output) {
|
||||
var steps = ref.images[image].steps;
|
||||
var out = steps[steps.length - 1].output.src;
|
||||
callback(out);
|
||||
|
||||
@@ -12,9 +12,6 @@ module.exports = function Invert(options, UI) {
|
||||
// The function which is called on every draw.
|
||||
function draw(input, callback, progressObj) {
|
||||
|
||||
console.log(this.getIndex());
|
||||
console.log(this.getPreviousStep().options.name);
|
||||
console.log(this.getStep(0).options.name);
|
||||
progressObj.stop(true);
|
||||
progressObj.overrideFlag = true;
|
||||
// Tell UI that a step is being drawn.
|
||||
|
||||
@@ -168,8 +168,18 @@ test('run() runs the sequencer and returns output to callback', function (t) {
|
||||
sequencer.run('test', function (out) {
|
||||
t.equal(typeof (sequencer.images.test.steps[sequencer.images.test.steps.length - 1].output), "object", "Output is Generated");
|
||||
t.equal(out, sequencer.images.test.steps[sequencer.images.test.steps.length - 1].output.src, "Output callback works");
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
test('getStep(offset) returns the step at offset distance relative to current step',function(t){
|
||||
sequencer.addSteps('test','invert',{});
|
||||
sequencer.addSteps('test','blend',{});
|
||||
sequencer.run('test',function(out){
|
||||
t.equal(!!out,true,"Blend generates output");
|
||||
t.end();
|
||||
});
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('replaceImage returns false in NodeJS', function (t) {
|
||||
|
||||
Reference in New Issue
Block a user