diff --git a/src/io.js b/src/io.js index 4113dfe..70b0946 100644 --- a/src/io.js +++ b/src/io.js @@ -8,8 +8,8 @@ const a = require('./assert') const kle = require('./kle') exports.interpret = (raw, logger) => { - let config - let format + let config = raw + let format = 'OBJ' if (a.type(raw)() != 'object') { try { config = yaml.safeLoad(raw) diff --git a/test/index.js b/test/index.js index d7ea67b..0dfee11 100644 --- a/test/index.js +++ b/test/index.js @@ -33,9 +33,9 @@ const cap = s => s.charAt(0).toUpperCase() + s.slice(1) const test = function(input_path) { this.timeout(120000) title = path.basename(input_path, '.yaml').split('_').join(' ') - it(title, function() { + it(title, async function() { const input = yaml.load(fs.readFileSync(input_path).toString()) - const actual = ergogen.process(input, true) + const actual = await ergogen.process(input, true) // if we're just creating the reference, we can dump the current output if (dump) { diff --git a/test/unit/interface.js b/test/unit/interface.js index be068a8..3de110d 100644 --- a/test/unit/interface.js +++ b/test/unit/interface.js @@ -54,22 +54,22 @@ const underscore = obj => { describe('Interface', function() { - it('minimal', function() { - underscore(ergogen.process(minimal)).should.be.false + it('minimal', async function() { + underscore(await ergogen.process(minimal)).should.be.false }) - it('production', function() { - underscore(ergogen.process(full, false)).should.be.false + it('production', async function() { + underscore(await ergogen.process(full, false)).should.be.false }) - it('debug', function() { - underscore(ergogen.process(full, true)).should.be.true + it('debug', async function() { + underscore(await ergogen.process(full, true)).should.be.true }) - it('logging', function() { + it('logging', async function() { const flag = {value: false} const logger = msg => { flag.value = true } - ergogen.process(full, false, logger) + await ergogen.process(full, false, logger) flag.value.should.be.true })