tests passing again

This commit is contained in:
jywarren
2017-03-03 16:12:39 -05:00
parent fc63c88d5a
commit 680526ff68
4 changed files with 620 additions and 149232 deletions

View File

@@ -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) {
//});