diff --git a/gunner/lib/runTests.js b/gunner/lib/runTests.js index da5a1c6..053f8a3 100644 --- a/gunner/lib/runTests.js +++ b/gunner/lib/runTests.js @@ -1,11 +1,12 @@ 'use strict'; -const { pass, fail } = require('../constants'); +const { pass, fail } = require('./constants'); -const runTests = tests => Promise.all(tests.map(test => - test.test() - .then(() => ({ description: test.description, result: pass })) - .catch(e => ({ description: test.description, result: fail, error: e })) -)); +const runTests = tests => Promise.all(tests.map(each => { + const pred = each.test(); + return (Array.isArray(pred) ? Promise.all(pred) : pred) + .then(() => ({ description: each.description, result: pass })) + .catch(e => ({ description: each.description, result: fail, error: e })); +})); module.exports = runTests; diff --git a/package.json b/package.json index a8263fa..42e48f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@klenty/gunner", - "version": "0.0.1", + "version": "0.1.0", "description": "Multi-strategy test runner.", "main": "index.js", "scripts": {