Meta modules (#308)

* meta-modules in node

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* meta-modules in browser

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* update docs

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* more doc

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* fix typo

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* update docs and sample meta-module

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* add dynamic modules CLI from npm

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* update

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* meta-modules and sequence saving completed

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* add docs

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* update docs

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* fixed test

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
This commit is contained in:
Varun Gupta
2018-08-04 19:37:20 +05:30
committed by Jeffrey Warren
parent 10e47656a3
commit 5ab018fb84
22 changed files with 664 additions and 306 deletions

View File

@@ -17,64 +17,64 @@ var test_png = require('./images/test.png.js');
var test_gif = require('./images/test.gif.js');
sequencer.loadImages(test_png);
sequencer.addSteps(['invert','invert']);
sequencer.addSteps(['invert', 'invert']);
test("Preload", function(t) {
sequencer.run({mode:'test'},function(){
sequencer.run({ mode: 'test' }, function() {
t.end();
});
});
test("Inverted image isn't identical", function (t) {
test("Inverted image isn't identical", function(t) {
var step1 = sequencer.images.image1.steps[0].output.src;
var step2 = sequencer.images.image1.steps[1].output.src;
step1 = DataURItoBuffer(step1);
step2 = DataURItoBuffer(step2);
looksSame(step1,step2,function(err,res){
if(err) console.log(err);
t.equal(res,false);
looksSame(step1, step2, function(err, res) {
if (err) console.log(err);
t.equal(res, false);
t.end();
});
});
test("Twice inverted image is identical to original image", function (t) {
test("Twice inverted image is identical to original image", function(t) {
var step1 = sequencer.images.image1.steps[0].output.src;
var step3 = sequencer.images.image1.steps[2].output.src;
step1 = DataURItoBuffer(step1);
step3 = DataURItoBuffer(step3);
looksSame(step1,step3,function(err,res){
if(err) console.log(err);
t.equal(res,true);
looksSame(step1, step3, function(err, res) {
if (err) console.log(err);
t.equal(res, true);
t.end();
});
});
test("Decode QR module works properly :: setup", function (t) {
sequencer.loadImage(qr,function(){
this.addSteps('decode-qr').run({mode:'test'},function(){
test("Decode QR module works properly :: setup", function(t) {
sequencer.loadImage(qr, function() {
this.addSteps('decode-qr').run({ mode: 'test' }, function() {
t.end();
});
})
});
test("Decode QR module works properly :: teardown", function (t) {
t.equal("http://github.com/publiclab/image-sequencer",sequencer.images.image2.steps[1].output.data);
test("Decode QR module works properly :: teardown", function(t) {
t.equal("http://github.com/publiclab/image-sequencer", sequencer.images.image2.steps[1].output.data);
t.end();
});
test("PixelManipulation works for PNG images", function (t) {
sequencer.loadImages(test_png,function(){
this.addSteps('invert').run({mode:'test'},function(out){
t.equal(1,1)
test("PixelManipulation works for PNG images", function(t) {
sequencer.loadImages(test_png, function() {
this.addSteps('invert').run({ mode: 'test' }, function(out) {
t.equal(1, 1)
t.end();
});
});
});
test("PixelManipulation works for GIF images", function (t) {
sequencer.loadImages(test_gif,function(){
this.addSteps('invert').run({mode:'test'},function(out){
t.equal(1,1)
test("PixelManipulation works for GIF images", function(t) {
sequencer.loadImages(test_gif, function() {
this.addSteps('invert').run({ mode: 'test' }, function(out) {
t.equal(1, 1)
t.end();
});
});