mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-12 19:30:00 +01:00
tests passing again
This commit is contained in:
@@ -8,22 +8,15 @@ var test = require('tape');
|
||||
|
||||
require('../dist/image-sequencer.js');
|
||||
|
||||
var sequencer = ImageSequencer({
|
||||
defaultSteps: function() {
|
||||
console.log('defaults');
|
||||
},
|
||||
ui: {
|
||||
create: function() {}
|
||||
}
|
||||
});
|
||||
var sequencer = ImageSequencer({ ui: false });
|
||||
|
||||
function read (file) {
|
||||
return fs.readFileSync('./test/fixtures/' + file, 'utf8').trim();
|
||||
}
|
||||
//function read (file) {
|
||||
// return fs.readFileSync('./test/fixtures/' + file, 'utf8').trim();
|
||||
//}
|
||||
|
||||
function write (file, data) { /* jshint ignore:line */
|
||||
return fs.writeFileSync('./test/fixtures/' + file, data + '\n', 'utf8');
|
||||
}
|
||||
//function write (file, data) { /* jshint ignore:line */
|
||||
// return fs.writeFileSync('./test/fixtures/' + file, data + '\n', 'utf8');
|
||||
//}
|
||||
|
||||
test('Image Sequencer has tests', function (t) {
|
||||
// read('something.html')
|
||||
@@ -38,10 +31,26 @@ test('addStep adds a step', function (t) {
|
||||
t.end();
|
||||
});
|
||||
|
||||
//test('test each module', function (t) {
|
||||
// steps.forEach(function(step, i) {
|
||||
// t.equal(step.test(step.testInput),step.testOutput);
|
||||
// // or check that it's equal with a diff method?
|
||||
// // we could also test each type of output
|
||||
// });
|
||||
test('each module conforms to base API except image-select', function (t) {
|
||||
Object.keys(sequencer.modules).forEach(function(moduleName, i) {
|
||||
if (moduleName != "image-select") sequencer.addStep(moduleName);
|
||||
});
|
||||
// should already have image-select:
|
||||
t.equal(sequencer.steps.length, Object.keys(sequencer.modules).length);
|
||||
sequencer.steps.forEach(function(step, i) {
|
||||
//t.equal(step.test(step.testInput),step.testOutput);
|
||||
// or check that it's equal with a diff method?
|
||||
// we could also test each type of output
|
||||
t.equal(step.setup === 'undefined', false);
|
||||
t.equal(step.draw === 'undefined', false);
|
||||
});
|
||||
t.end();
|
||||
});
|
||||
|
||||
//test('a blank module does not modify an image, according to diff', function (t) {
|
||||
|
||||
//});
|
||||
|
||||
//test('a module modifies an image', function (t) {
|
||||
|
||||
//});
|
||||
|
||||
Reference in New Issue
Block a user