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", "name": "@klenty/gunner",
"version": "0.9.2", "version": "0.9.3",
"description": "Zero magic, fast test-runner and assertion framework. No magic globals.", "description": "Zero magic, fast test-runner and assertion framework. No magic globals.",
"main": "index.js", "main": "index.js",
"repository": { "repository": {

5
src/lib/assertionsLibrary.js

@ -22,6 +22,11 @@ module.exports.isArray =
val => Array.isArray(val), val => Array.isArray(val),
val => _`${(val)} is not an array`, val => _`${(val)} is not an array`,
]; ];
module.exports.isObject =
[
val => typeof val === 'object' && val !== null,
val => _`${val} is not an object`,
];
module.exports.hasLength = module.exports.hasLength =
[ [
(val, l) => val.length === l, (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 = expect;
module.exports.expectMany = expectMany; module.exports.expectMany = expectMany;

4
src/lib/testrunner.js

@ -113,11 +113,11 @@ const reduceQueue =
*/ */
const testrunner = (instance) => { const testrunner = (instance) => {
return pipe( return Promise.object(pipe(
buildTestQueue, buildTestQueue,
reduceQueue, reduceQueue,
pick('results'), pick('results'),
)(instance); )(instance));
}; };

3
src/strategy/index.js

@ -1,5 +1,4 @@
const requireDeep = require('../util/requireDeep'); const requireDeep = require('../util/requireDeep');
const Runner = require('../runner');
class Strategy { class Strategy {
@ -63,7 +62,7 @@ class Strategy {
const runOptions = options || this.__runTimeOptions; const runOptions = options || this.__runTimeOptions;
return Promise.all(this.__await__).then(() => ( return Promise.all(this.__await__).then(() => (
Runner(this.__gunnerInstances)(runOptions))); this.__gunnerInstances.run(runOptions)));
} }
} }

Loading…
Cancel
Save