diff --git a/package.json b/package.json index d49c0a1..2cf50ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@klenty/gunner", - "version": "0.9.2", + "version": "0.9.3", "description": "Zero magic, fast test-runner and assertion framework. No magic globals.", "main": "index.js", "repository": { diff --git a/src/lib/assertionsLibrary.js b/src/lib/assertionsLibrary.js index a3b9331..d9fe8f7 100644 --- a/src/lib/assertionsLibrary.js +++ b/src/lib/assertionsLibrary.js @@ -22,6 +22,11 @@ module.exports.isArray = val => Array.isArray(val), val => _`${(val)} is not an array`, ]; +module.exports.isObject = + [ + val => typeof val === 'object' && val !== null, + val => _`${val} is not an object`, + ]; module.exports.hasLength = [ (val, l) => val.length === l, diff --git a/src/lib/expect.js b/src/lib/expect.js index 4e4f455..99f640c 100644 --- a/src/lib/expect.js +++ b/src/lib/expect.js @@ -60,7 +60,7 @@ const expect = (thing, args) => }, }); -const expectMany = Promise.all.bind(Promise); +const expectMany = (...expects) => Promise.all(expects); module.exports = expect; module.exports.expectMany = expectMany; diff --git a/src/lib/testrunner.js b/src/lib/testrunner.js index b3ab3bf..9d506d1 100644 --- a/src/lib/testrunner.js +++ b/src/lib/testrunner.js @@ -113,11 +113,11 @@ const reduceQueue = */ const testrunner = (instance) => { - return pipe( + return Promise.object(pipe( buildTestQueue, reduceQueue, pick('results'), - )(instance); + )(instance)); }; diff --git a/src/strategy/index.js b/src/strategy/index.js index 8e578cc..eff5f87 100644 --- a/src/strategy/index.js +++ b/src/strategy/index.js @@ -1,5 +1,4 @@ const requireDeep = require('../util/requireDeep'); -const Runner = require('../runner'); class Strategy { @@ -63,7 +62,7 @@ class Strategy { const runOptions = options || this.__runTimeOptions; return Promise.all(this.__await__).then(() => ( - Runner(this.__gunnerInstances)(runOptions))); + this.__gunnerInstances.run(runOptions))); } }