mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-12 03:10:03 +01:00
Removed all instances of mode: 'test' (#1599)
This commit is contained in:
@@ -30,7 +30,7 @@ test('blend module loads with correct options', t => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('blend module works correctly', t => {
|
test('blend module works correctly', t => {
|
||||||
sequencer.run({mode: 'test'}, () => {
|
sequencer.run(() => {
|
||||||
|
|
||||||
let result = sequencer.steps[2].output.src;
|
let result = sequencer.steps[2].output.src;
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ test('Check Options', function(t) {
|
|||||||
|
|
||||||
// Test 3 to check brightness module works as expected
|
// Test 3 to check brightness module works as expected
|
||||||
test('canvas-resize module works correctly', function(t) {
|
test('canvas-resize module works correctly', function(t) {
|
||||||
sequencer.run({ mode: 'test' }, function(out) {
|
sequencer.run(function(out) {
|
||||||
var result = sequencer.steps[1].output.src;
|
var result = sequencer.steps[1].output.src;
|
||||||
require('get-pixels')(result, (err, pix) => {
|
require('get-pixels')(result, (err, pix) => {
|
||||||
t.equal(pix.shape[0], 500);
|
t.equal(pix.shape[0], 500);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ test('Load Decode-Qr module', function(t) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Decode-qr module works correctly', function(t) {
|
test('Decode-qr module works correctly', function(t) {
|
||||||
sequencer.run({ mode: 'test' }, function(out) {
|
sequencer.run(function(out) {
|
||||||
var result = sequencer.steps[1].options.step.qrval;
|
var result = sequencer.steps[1].options.step.qrval;
|
||||||
t.equal(result, 'http://github.com/publiclab/image-sequencer', 'should be equal');
|
t.equal(result, 'http://github.com/publiclab/image-sequencer', 'should be equal');
|
||||||
t.end();
|
t.end();
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ test('Load invert module', function(t) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Inverted image isn\'t identical', function(t) {
|
test('Inverted image isn\'t identical', function(t) {
|
||||||
sequencer.run({ mode: 'test' }, function(out) {
|
sequencer.run(function(out) {
|
||||||
var input = sequencer.steps[0].output.src;
|
var input = sequencer.steps[0].output.src;
|
||||||
var output = sequencer.steps[1].output.src;
|
var output = sequencer.steps[1].output.src;
|
||||||
input = DataURItoBuffer(input);
|
input = DataURItoBuffer(input);
|
||||||
@@ -40,7 +40,7 @@ test('Inverted image isn\'t identical', function(t) {
|
|||||||
|
|
||||||
// test("Twice inverted image is identical to original image", function(t) {
|
// test("Twice inverted image is identical to original image", function(t) {
|
||||||
// sequencer.addSteps('test','invert');
|
// sequencer.addSteps('test','invert');
|
||||||
// sequencer.run({ mode: 'test' }, function(out) {
|
// sequencer.run(function(out) {
|
||||||
// var input = sequencer.steps[0].output.src
|
// var input = sequencer.steps[0].output.src
|
||||||
// var output = sequencer.steps[2].output.src
|
// var output = sequencer.steps[2].output.src
|
||||||
// base64Img.imgSync(input, target, 'input')
|
// base64Img.imgSync(input, target, 'input')
|
||||||
@@ -56,7 +56,7 @@ test('Inverted image isn\'t identical', function(t) {
|
|||||||
// });
|
// });
|
||||||
|
|
||||||
test('Invert module produces correct output', function(t) {
|
test('Invert module produces correct output', function(t) {
|
||||||
sequencer.run({ mode: 'test' }, function(out) {
|
sequencer.run(function(out) {
|
||||||
var result = sequencer.steps[1].output.src;
|
var result = sequencer.steps[1].output.src;
|
||||||
var benchmark = invert;
|
var benchmark = invert;
|
||||||
base64Img.imgSync(result, target, 'result');
|
base64Img.imgSync(result, target, 'result');
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ test('Check Options', function(t) {
|
|||||||
|
|
||||||
// Test 3 to check Text Overlay module works as expected.
|
// Test 3 to check Text Overlay module works as expected.
|
||||||
// test('Text Overlay module works correctly', function(t) {
|
// test('Text Overlay module works correctly', function(t) {
|
||||||
// sequencer.run({ mode: 'test' }, function(out) {
|
// sequencer.run(function(out) {
|
||||||
// // The test runs in node , and the text overlay is a browser only module,
|
// // The test runs in node , and the text overlay is a browser only module,
|
||||||
// // thus it there is no image processing and output is same as input.
|
// // thus it there is no image processing and output is same as input.
|
||||||
// var result = sequencer.steps[1].output.src;
|
// var result = sequencer.steps[1].output.src;
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ test('getSteps() returns correct array of steps', function(t){
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('run() runs the sequencer and returns output to callback', function(t) {
|
test('run() runs the sequencer and returns output to callback', function(t) {
|
||||||
sequencer.run({ mode: 'test' }, function(out) {
|
sequencer.run(function(out) {
|
||||||
t.equal(typeof (sequencer.steps[sequencer.steps.length - 1].output), 'object', 'Output is Generated');
|
t.equal(typeof (sequencer.steps[sequencer.steps.length - 1].output), 'object', 'Output is Generated');
|
||||||
t.equal(out, sequencer.steps[sequencer.steps.length - 1].output.src, 'Output callback works');
|
t.equal(out, sequencer.steps[sequencer.steps.length - 1].output.src, 'Output callback works');
|
||||||
t.end();
|
t.end();
|
||||||
@@ -185,7 +185,7 @@ test('run() runs the sequencer and returns output to callback', function(t) {
|
|||||||
test('getStep(offset) returns the step at offset distance relative to current step', function(t) {
|
test('getStep(offset) returns the step at offset distance relative to current step', function(t) {
|
||||||
sequencer.addSteps('invert', {});
|
sequencer.addSteps('invert', {});
|
||||||
sequencer.addSteps('blend', {});
|
sequencer.addSteps('blend', {});
|
||||||
sequencer.run({ mode: 'test' }, function(out) {
|
sequencer.run(function(out) {
|
||||||
t.equal(!!out, true, 'Blend generates output');
|
t.equal(!!out, true, 'Blend generates output');
|
||||||
t.end();
|
t.end();
|
||||||
});
|
});
|
||||||
@@ -202,7 +202,7 @@ test('blend returns different output depending on the set offset', function(t) {
|
|||||||
sequencer.addSteps('blend', {});
|
sequencer.addSteps('blend', {});
|
||||||
// because we've added blend before, so instead of -3 we set it to -4
|
// because we've added blend before, so instead of -3 we set it to -4
|
||||||
sequencer.addSteps('blend', {'offset': -4});
|
sequencer.addSteps('blend', {'offset': -4});
|
||||||
sequencer.run({ mode: 'test' }, function(out) {
|
sequencer.run(function(out) {
|
||||||
t.notStrictEqual(out, sequencer.steps[sequencer.steps.length - 2].output.src, 'different offsets give different output');
|
t.notStrictEqual(out, sequencer.steps[sequencer.steps.length - 2].output.src, 'different offsets give different output');
|
||||||
t.end();
|
t.end();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ module.exports = (moduleName, options, benchmark, input) => {
|
|||||||
// Add the step.
|
// Add the step.
|
||||||
sequencer.addSteps(moduleName, options[0]);
|
sequencer.addSteps(moduleName, options[0]);
|
||||||
// Run the ImageSequencer with initial option.
|
// Run the ImageSequencer with initial option.
|
||||||
sequencer.run({ mode: 'test' }, () => {
|
sequencer.run(() => {
|
||||||
let result = sequencer.steps[1].output.src;
|
let result = sequencer.steps[1].output.src;
|
||||||
|
|
||||||
base64Img.imgSync(result, target, 'result');
|
base64Img.imgSync(result, target, 'result');
|
||||||
@@ -42,7 +42,7 @@ module.exports = (moduleName, options, benchmark, input) => {
|
|||||||
// Change the option of the given module.
|
// Change the option of the given module.
|
||||||
sequencer.steps[1].setOptions(options[1]);
|
sequencer.steps[1].setOptions(options[1]);
|
||||||
// Run the ImageSequencer witch changed option.
|
// Run the ImageSequencer witch changed option.
|
||||||
sequencer.run({ mode: 'test' }, () => {
|
sequencer.run(() => {
|
||||||
let newResult = sequencer.steps[1].output.src;
|
let newResult = sequencer.steps[1].output.src;
|
||||||
|
|
||||||
base64Img.imgSync(newResult, target, 'newResult');
|
base64Img.imgSync(newResult, target, 'newResult');
|
||||||
|
|||||||
Reference in New Issue
Block a user