Browse Source

[runner] Minor fixes, removing Gunner/Runner dependency

master
Muthu Kumar 6 years ago
parent
commit
4f53a8e52f
  1. 2
      package.json
  2. 5
      src/lib/assertionsLibrary.js
  3. 2
      src/lib/expect.js
  4. 4
      src/lib/testrunner.js
  5. 3
      src/strategy/index.js

2
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": {

5
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,

2
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;

4
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));
};

3
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)));
}
}

Loading…
Cancel
Save