final sweep, moved everything to _v4

This commit is contained in:
spalger
2016-05-19 14:23:33 -07:00
parent 4a77556866
commit ec06c51c5d
78 changed files with 542 additions and 542 deletions

View File

@ -1,6 +1,6 @@
var clock = require('sinon').useFakeTimers();
var Client = require('../../src/elasticsearch').Client;
var _ = require('lodash-migrate');
// var _ = require('lodash');
var times = require('async').times;
process.once('message', function (port) {
@ -20,9 +20,9 @@ process.once('message', function (port) {
clock.tick(10);
}, function (err) {
var conns = es.transport.connectionPool._conns;
var sockets = _([].concat(conns.dead, conns.alive))
var sockets = _v4([].concat(conns.dead, conns.alive))
.transform(function (sockets, conn) {
sockets.push(_.values(conn.agent.sockets), _.values(conn.agent.freeSockets));
sockets.push(_v4.values(conn.agent.sockets), _v4.values(conn.agent.freeSockets));
}, [])
.flattenDeep()
.value();
@ -31,8 +31,8 @@ process.once('message', function (port) {
var out = {
socketCount: err || sockets.length,
remaining: _.where(sockets, { destroyed: true }).length - sockets.length,
timeouts: _.size(clock.timers) && _.map(clock.timers, 'func').map(String)
remaining: _v4.filter(sockets, { destroyed: true }).length - sockets.length,
timeouts: _v4.size(clock.timers) && _v4.map(clock.timers, 'func').map(String)
};
clock.restore();

View File

@ -9,10 +9,10 @@ if (BROWSER) {
es = require('../../../src/elasticsearch');
}
var _ = require('../../../src/lib/utils');
// var _ = require('../../../src/lib/utils');
var path = require('path');
var fs = require('fs');
var fromRoot = _.bindKey(path, 'join', require('find-root')(__dirname));
var fromRoot = _v4.bindKey(path, 'join', require('find-root')(__dirname));
var Bluebird = require('bluebird');
// current client
@ -60,7 +60,7 @@ module.exports = {
}
var logConfig = {};
if (_.has(options, 'logConfig')) {
if (_v4.has(options, 'logConfig')) {
logConfig = options.logConfig;
} else {
if (BROWSER) {
@ -106,14 +106,14 @@ module.exports = {
client.snapshot.getRepository({
snapshot: '_all'
})
.then(_.keys)
.then(_v4.keys)
.map(function (repo) {
return client.snapshot.get({
repository: repo,
snapshot: '_all'
})
.then(function (resp) {
return _.map(resp.snapshots, 'snapshot');
return _v4.map(resp.snapshots, 'snapshot');
}, function () {
return [];
})
@ -132,7 +132,7 @@ module.exports = {
]);
};
_.nextTick(cb);
_v4.nextTick(cb);
}
},
get: function () {

View File

@ -4,7 +4,7 @@ module.exports = function (branch) {
var YamlFile = require('./yaml_file');
var root = require('find-root')(__dirname);
var rootReq = function (loc) { return require(path.join(root, loc)); };
var _ = rootReq('src/lib/utils');
// var _ = rootReq('src/lib/utils');
var utils = rootReq('grunt/utils');
var es = rootReq('src/elasticsearch');
var clientManager = require('./client_manager');
@ -32,7 +32,7 @@ module.exports = function (branch) {
return clientManager.get().clearEs();
});
var files = _v4.map(require('./yaml_tests_' + _.snakeCase(branch) + '.json'), function (docs, filename) {
var files = _v4.map(require('./yaml_tests_' + _v4.snakeCase(branch) + '.json'), function (docs, filename) {
return new YamlFile(filename, docs);
});

View File

@ -9,7 +9,7 @@
*/
module.exports = YamlDoc;
var _ = require('lodash-migrate/lodash');
// var _ = require('lodash-migrate/lodash');
var expect = require('expect.js');
var clientManager = require('./client_manager');
var inspect = require('util').inspect;
@ -70,8 +70,8 @@ function versionToComparableString(version, def) {
return def;
}
var parts = _.map(version.split('.'), function (part) {
part = '' + _.parseInt(part);
var parts = _v4.map(version.split('.'), function (part) {
part = '' + _v4.parseInt(part);
return (new Array(Math.max(4 - part.length, 0))).join('0') + part;
});
@ -109,26 +109,26 @@ function YamlDoc(doc, file) {
var self = this;
self.file = file;
self.description = _.keys(doc).shift();
self.description = _v4.keys(doc).shift();
self._stash = {};
self._last_requests_response = null;
// setup the actions, creating a bound and testable method for each
self._actions = _.map(self.flattenTestActions(doc[self.description]), function (action) {
self._actions = _v4.map(self.flattenTestActions(doc[self.description]), function (action) {
// get the method that will do the action
var method = self['do_' + action.name];
// check that it's a function
expect(method || 'YamlDoc#' + action.name).to.be.a('function');
if (_.isPlainObject(action.args)) {
if (_v4.isPlainObject(action.args)) {
action.name += '(' + JSON.stringify(action.args) + ')';
} else if (action.args) {
action.name += '(' + action.args + ')';
}
// wrap in a check for skipping
action.bound = _.bind(method, self, action.args);
action.bound = _v4.bind(method, self, action.args);
// create a function that can be passed to mocha or async
action.testable = function (_cb) {
@ -199,15 +199,15 @@ YamlDoc.prototype = {
flattenTestActions: function (config) {
// creates [ [ {name:"", args:"" }, ... ], ... ]
// from [ {name:args, name:args}, {name:args} ]
var actionSets = _.map(config, function (set) {
return _.map(_.toPairs(set), function (pair) {
var actionSets = _v4.map(config, function (set) {
return _v4.map(_v4.toPairs(set), function (pair) {
return { name: pair[0], args: pair[1] };
});
});
// do a single level flatten, merge=ing the nested arrays from step one
// into a master array, creating an array of action objects
return _.reduce(actionSets, function (note, set) {
return _v4.reduce(actionSets, function (note, set) {
return note.concat(set);
}, []);
},
@ -273,7 +273,7 @@ YamlDoc.prototype = {
log('getting', path, 'from', from);
var steps = _.map(path ? path.replace(/\\\./g, '\uffff').split('.') : [], function (step) {
var steps = _v4.map(path ? path.replace(/\\\./g, '\uffff').split('.') : [], function (step) {
return step.replace(/\uffff/g, '.');
});
var remainingSteps;
@ -301,7 +301,7 @@ YamlDoc.prototype = {
*/
do_skip: function (args, done) {
if (args.version) {
return rangeMatchesCurrentVersion(args.version, _.bind(function (match) {
return rangeMatchesCurrentVersion(args.version, _v4.bind(function (match) {
if (match) {
if (this.description === 'setup') {
this.file.skipping = true;
@ -320,7 +320,7 @@ YamlDoc.prototype = {
if (args.features) {
var features = Array.isArray(args.features) ? args.features : [args.features];
var notImplemented = _.difference(features, implementedFeatures);
var notImplemented = _v4.difference(features, implementedFeatures);
if (notImplemented.length) {
if (this.description === 'setup') {
@ -396,19 +396,19 @@ YamlDoc.prototype = {
delete args.headers;
}
var otherKeys = _.keys(args);
var otherKeys = _v4.keys(args);
var action = otherKeys.shift();
if (otherKeys.length) {
return done(new TypeError('Unexpected top-level args to "do": ' + otherKeys.join(', ')));
}
var client = clientManager.get();
var clientActionName = _.map(action.split('.'), _.camelCase).join('.');
var clientActionName = _v4.map(action.split('.'), _v4.camelCase).join('.');
var clientAction = this.get(clientActionName, client);
_.assign(inputParams, args[action]);
_v4.assign(inputParams, args[action]);
var params = _.transform(inputParams, _.bind(function (params, val, name) {
var camelName = _.camelCase(name);
var params = _v4.transform(inputParams, _v4.bind(function (params, val, name) {
var camelName = _v4.camelCase(name);
// search through the params and url peices to find this param name
var paramName = name;
@ -427,10 +427,10 @@ YamlDoc.prototype = {
// for ercursively traversing the params to replace '$stashed' vars
var transformObject = function (vals, val, i) {
if (_.isString(val)) {
if (_v4.isString(val)) {
val = (val[0] === '$') ? this.get(val) : val;
} else if (_.isPlainObject(val) || _.isArray(val)) {
val = _.transform(val, transformObject);
} else if (_v4.isPlainObject(val) || _v4.isArray(val)) {
val = _v4.transform(val, transformObject);
}
vals[i] = val;
@ -443,12 +443,12 @@ YamlDoc.prototype = {
expect(clientAction || clientActionName).to.be.a('function');
if (!isNaN(parseFloat(catcher))) {
params.ignore = _.union(params.ignore || [], [catcher]);
params.ignore = _v4.union(params.ignore || [], [catcher]);
catcher = null;
}
var timeoutId;
var cb = _.bind(function (error, body) {
var cb = _v4.bind(function (error, body) {
this._last_requests_response = body;
clearTimeout(timeoutId);
@ -494,7 +494,7 @@ YamlDoc.prototype = {
* @return {undefined}
*/
do_set: function (args) {
_.forOwn(args, _.bind(function (name, path) {
_v4.forOwn(args, _v4.bind(function (name, path) {
this._stash[name] = this.get(path);
}, this));
},
@ -566,25 +566,25 @@ YamlDoc.prototype = {
var self = this;
// recursively replace all $var within args
_.forOwn(args, function recurse(val, key, lvl) {
if (_.isObject(val)) {
_v4.forOwn(args, function recurse(val, key, lvl) {
if (_v4.isObject(val)) {
return _v4.each(val, recurse);
}
if (_.isString(val)) {
if (_v4.isString(val)) {
lvl[key] = val.replace(/\$[a-zA-Z0-9_]+/g, function (name) {
return self.get(name);
});
}
});
_.forOwn(args, _.bind(function (match, path) {
_v4.forOwn(args, _v4.bind(function (match, path) {
var origMatch = match;
var maybeRE = false;
var usedRE = false;
if (_.isString(match)) {
if (_v4.isString(match)) {
// convert the matcher into a compatible string for building a regexp
maybeRE = match
// replace comments, but allow the # to be escaped like \#
@ -655,7 +655,7 @@ YamlDoc.prototype = {
* @return {undefined}
*/
do_lt: function (args) {
_.forOwn(args, _.bind(function (num, path) {
_v4.forOwn(args, _v4.bind(function (num, path) {
expect(this.get(path)).to.be.below(num, 'path: ' + path);
}, this));
},
@ -667,7 +667,7 @@ YamlDoc.prototype = {
* @return {undefined}
*/
do_lte: function (args) {
_.forOwn(args, _.bind(function (num, path) {
_v4.forOwn(args, _v4.bind(function (num, path) {
expect(this.get(path) <= num).to.be.ok('path: ' + path);
}, this));
},
@ -679,7 +679,7 @@ YamlDoc.prototype = {
* @return {undefined}
*/
do_gt: function (args) {
_.forOwn(args, _.bind(function (num, path) {
_v4.forOwn(args, _v4.bind(function (num, path) {
expect(this.get(path)).to.be.above(num, 'path: ' + path);
}, this));
},
@ -691,7 +691,7 @@ YamlDoc.prototype = {
* @return {undefined}
*/
do_gte: function (args) {
_.forOwn(args, _.bind(function (num, path) {
_v4.forOwn(args, _v4.bind(function (num, path) {
expect(this.get(path) >= num).to.be.ok('path: ' + path);
}, this));
},
@ -704,8 +704,8 @@ YamlDoc.prototype = {
* @return {undefined}
*/
do_length: function (args) {
_.forOwn(args, _.bind(function (len, path) {
expect(_.size(this.get(path))).to.eql(len, 'path: ' + path);
_v4.forOwn(args, _v4.bind(function (len, path) {
expect(_v4.size(this.get(path))).to.eql(len, 'path: ' + path);
}, this));
}
};

View File

@ -8,7 +8,7 @@ module.exports = YamlFile;
var YamlDoc = require('./yaml_doc');
var clientManager = require('./client_manager');
var _ = require('../../../src/lib/utils');
// var _ = require('../../../src/lib/utils');
var async = require('async');
function YamlFile(filename, docs) {

View File

@ -27,7 +27,7 @@
module.exports = MockHttpRequest;
var _ = require('lodash-migrate');
// var _ = require('lodash');
function MockHttpRequest() {
// These are internal flags and data structures

View File

@ -3,7 +3,7 @@ var complete = [];
var MockHttpRequest = require('./browser_http');
var XhrServer = MockHttpRequest.MockHttpServer;
var parseUrl = MockHttpRequest.prototype.parseUri;
var _ = require('lodash-migrate');
// var _ = require('lodash');
var server = new XhrServer(function (request) {
var reqDetails = {

View File

@ -1,4 +1,5 @@
var _ = require('lodash-migrate');
/* global angular */
// var _ = require('lodash');
var expect = require('expect.js');
var Promise = require('bluebird');
var sinon = require('sinon');
@ -16,13 +17,13 @@ describe('Angular esFactory', function () {
function bootstrap(env) {
beforeEach(function () {
var promiseProvider = _.noop;
var promiseProvider = _v4.noop;
if (env.bluebirdPromises) {
promiseProvider = function ($provide) {
$provide.service('$q', function () {
return {
defer: function () {
return _.bindAll(Promise.defer(), ['resolve', 'reject']);
return _v4.bindAll(Promise.defer(), ['resolve', 'reject']);
},
reject: Promise.reject,
when: Promise.resolve,

View File

@ -1,3 +1,4 @@
/* global $ */
var expect = require('expect.js');
var Transport = require('../../../src/lib/transport');

View File

@ -3,7 +3,7 @@ module.exports = function (makeLogger) {
var stub = require('../utils/auto_release_stub').make();
var fs = require('fs');
var once = require('events').EventEmitter.prototype.once;
var _ = require('lodash-migrate');
// var _ = require('lodash');
describe('buffer flush', function () {
if (require('stream').Writable) {

View File

@ -1,7 +1,7 @@
var ca = require('../../../src/lib/client_action').factory;
var proxy = require('../../../src/lib/client_action').proxyFactory;
var expect = require('expect.js');
var _ = require('lodash-migrate');
// var _ = require('lodash');
var Promise = require('bluebird');
/**
@ -45,7 +45,7 @@ function makeClientAction(spec) {
};
}
return _.bind(ca(spec), mockClient());
return _v4.bind(ca(spec), mockClient());
}
/**
@ -55,7 +55,7 @@ function makeClientAction(spec) {
* @return {Function} - the clientActionProxy
*/
function makeClientActionProxy(fn, spec) {
return _.bind(proxy(fn, spec || {}), mockClient());
return _v4.bind(proxy(fn, spec || {}), mockClient());
}
@ -118,7 +118,7 @@ describe('Client Action runner', function () {
it('handles passing just the callback', function () {
var action = makeClientActionProxy(function (params, cb) {
expect(_.isObject(params)).to.be.ok();
expect(_v4.isObject(params)).to.be.ok();
expect(cb).to.be.a('function');
});

View File

@ -2,7 +2,7 @@ var ConnectionAbstract = require('../../../src/lib/connection');
var Host = require('../../../src/lib/host');
var sinon = require('sinon');
var expect = require('expect.js');
var _ = require('lodash-migrate');
// var _ = require('lodash');
var errors = require('../../../src/lib/errors');
var stub = require('../../utils/auto_release_stub').make();
@ -73,10 +73,10 @@ describe('Connection Abstract', function () {
stub(conn, 'request');
expect(_.size(clock.timers)).to.eql(0);
expect(_v4.size(clock.timers)).to.eql(0);
conn.ping();
expect(_.size(clock.timers)).to.eql(1);
expect(clock.timers[_.keys(clock.timers).shift()].delay).to.eql(5000);
expect(_v4.size(clock.timers)).to.eql(1);
expect(clock.timers[_v4.keys(clock.timers).shift()].delay).to.eql(5000);
});
it('calls it\'s own request method', function () {

View File

@ -1,7 +1,7 @@
var ConnectionPool = require('../../../src/lib/connection_pool');
var Host = require('../../../src/lib/host');
var ConnectionAbstract = require('../../../src/lib/connection');
var _ = require('lodash-migrate');
// var _ = require('lodash');
var EventEmitter = require('events').EventEmitter;
var expect = require('expect.js');
var sinon = require('sinon');
@ -36,10 +36,10 @@ describe('Connection Pool', function () {
});
it('#addConnection only adds the connection if it doesn\'t already exist', function () {
expect(_.keys(pool.index).length).to.eql(0);
expect(_v4.keys(pool.index).length).to.eql(0);
pool.addConnection(connection);
expect(_.keys(pool.index)).to.eql([host.toString()]);
expect(_v4.keys(pool.index)).to.eql([host.toString()]);
expect(pool._conns.alive).to.eql([connection]);
expect(pool._conns.dead).to.eql([]);
@ -52,7 +52,7 @@ describe('Connection Pool', function () {
expect(pool._conns.alive).to.eql([connection]);
expect(pool._conns.dead).to.eql([]);
expect(_.keys(pool.index).length).to.eql(1);
expect(_v4.keys(pool.index).length).to.eql(1);
});
it('closes the connection when it removes it', function () {
@ -247,13 +247,13 @@ describe('Connection Pool', function () {
stub.autoRelease(clock);
connection.setStatus('dead');
expect(_.size(clock.timers)).to.eql(1);
var id = _(clock.timers).keys().first();
expect(_v4.size(clock.timers)).to.eql(1);
var id = _v4(clock.timers).keys().first();
// it re-dies
connection.setStatus('dead');
expect(_.size(clock.timers)).to.eql(1);
expect(_(clock.timers).keys().first()).to.not.eql(id);
expect(_v4.size(clock.timers)).to.eql(1);
expect(_v4(clock.timers).keys().first()).to.not.eql(id);
});
it('does nothing when a connection is re-alive', function () {
@ -295,7 +295,7 @@ describe('Connection Pool', function () {
var result = pool.getConnections();
expect(result.length).to.be(1000);
expect(_.reduce(result, function (sum, num) {
expect(_v4.reduce(result, function (sum, num) {
sum += num
return sum;
}, 0)).to.eql(499500);

View File

@ -1,6 +1,6 @@
var errors = require('../../../src/lib/errors');
var expect = require('expect.js');
var _ = require('lodash-migrate');
// var _ = require('lodash');
_v4.each(errors, function (CustomError, name) {
if (name.charAt(0) !== '_') {

View File

@ -2,7 +2,7 @@ describe('File Logger', function () {
var Log = require('../../../src/lib/log');
var FileLogger = require('../../../src/lib/loggers/file');
var once = require('events').EventEmitter.prototype.once;
var _ = require('../../../src/lib/utils');
// var _ = require('../../../src/lib/utils');
var parentLog;
var logger;
var expect = require('expect.js');
@ -15,7 +15,7 @@ describe('File Logger', function () {
afterEach(function () {
parentLog.close();
logger && _.clearWriteStreamBuffer(logger.stream);
logger && _v4.clearWriteStreamBuffer(logger.stream);
});
function makeLogger(parent, levels) {

View File

@ -1,5 +1,5 @@
var Host = require('../../../src/lib/host');
var _ = require('lodash-migrate');
// var _ = require('lodash');
var expect = require('expect.js');
var url = require('url');
var expectSubObject = require('../../utils/expect_sub_object');

View File

@ -1,6 +1,6 @@
describe('Http Connector', function () {
var _ = require('lodash-migrate');
// var _ = require('lodash');
var expect = require('expect.js');
var nock = require('nock');
var sinon = require('sinon');
@ -67,12 +67,12 @@ describe('Http Connector', function () {
it('allows defining a custom agent', function () {
var football = {};
var con = new HttpConnection(new Host(), { createNodeAgent: _.constant(football) });
var con = new HttpConnection(new Host(), { createNodeAgent: _v4.constant(football) });
expect(con.agent).to.be(football);
});
it('allows setting agent to false', function () {
var con = new HttpConnection(new Host(), { createNodeAgent: _.constant(false) });
var con = new HttpConnection(new Host(), { createNodeAgent: _v4.constant(false) });
expect(con.agent).to.be(false);
});
});
@ -482,7 +482,7 @@ describe('Http Connector', function () {
this.timeout(5 * 60 * 1000);
var cp = require('child_process');
var path = require('path');
var fixture = _.partial(path.join, __dirname, '../../fixtures');
var fixture = _v4.partial(path.join, __dirname, '../../fixtures');
var timeout; // start the timeout once we hear back from the client
var server = cp.fork(fixture('keepalive_server.js'))

View File

@ -1,5 +1,5 @@
var Log = require('../../../src/lib/log');
var _ = require('lodash-migrate');
// var _ = require('lodash');
var expect = require('expect.js');
describe('Log class', function () {
@ -129,11 +129,11 @@ describe('Log class', function () {
log: [
{
type: function (log, config) {
log.on('error', _.noop);
log.on('warning', _.noop);
log.on('info', _.noop);
log.on('debug', _.noop);
log.on('trace', _.noop);
log.on('error', _v4.noop);
log.on('warning', _v4.noop);
log.on('info', _v4.noop);
log.on('debug', _v4.noop);
log.on('trace', _v4.noop);
}
}
]

View File

@ -1,18 +1,18 @@
describe('Random Selector', function () {
var randomSelector = require('../../../src/lib/selectors/random');
var _ = require('lodash-migrate');
// var _ = require('lodash');
var expect = require('expect.js');
it('chooses a selection by random', function () {
var log = { a: 0, b: 0, c: 0 };
var choices = _.keys(log);
var choices = _v4.keys(log);
_v4.times(1000, function () {
var choice = randomSelector(choices);
log[choice]++;
});
expect(_.filter(log, function (count) {
expect(_v4.filter(log, function (count) {
return count < 200 || count > 400;
})).to.have.length(0);

View File

@ -1,6 +1,6 @@
describe('Round Robin Selector', function () {
var selector = require('../../../src/lib/selectors/round_robin');
var _ = require('lodash-migrate');
// var _ = require('lodash');
var expect = require('expect.js');
it('chooses options in order', function () {

View File

@ -4,7 +4,7 @@ describe('Stream Logger', function () {
var MockWritableStream = require('../../mocks/writable_stream');
var once = require('events').EventEmitter.prototype.once;
var stream = new MockWritableStream();
var _ = require('../../../src/lib/utils');
// var _ = require('../../../src/lib/utils');
var expect = require('expect.js');
var parentLog;
@ -19,7 +19,7 @@ describe('Stream Logger', function () {
afterEach(function () {
parentLog.close();
_.clearWriteStreamBuffer(stream);
_v4.clearWriteStreamBuffer(stream);
});
function makeLogger(parent, levels) {
@ -41,7 +41,7 @@ describe('Stream Logger', function () {
// get the last handler for process's "exit" event
var exitHandlers = process._events.exit;
var exitHandler = _.isArray(exitHandlers) ? _.last(exitHandlers) : exitHandlers;
var exitHandler = _v4.isArray(exitHandlers) ? _v4.last(exitHandlers) : exitHandlers;
// allow the logger to acctually write to the stream
stream.write.restore();

View File

@ -4,7 +4,7 @@ var errors = require('../../../src/lib/errors');
var sinon = require('sinon');
var expect = require('expect.js');
var _ = require('lodash-migrate');
// var _ = require('lodash');
var nodeList = require('../../fixtures/short_node_list.json');
var stub = require('../../utils/auto_release_stub').make();
@ -83,11 +83,11 @@ describe('Transport Class', function () {
sniffInterval: 25000
});
expect(_.size(clock.timers)).to.eql(1);
var id = _.keys(clock.timers).pop();
expect(_v4.size(clock.timers)).to.eql(1);
var id = _v4.keys(clock.timers).pop();
clock.tick(25000);
expect(trans.sniff.callCount).to.eql(1);
expect(_.size(clock.timers)).to.eql(1);
expect(_v4.size(clock.timers)).to.eql(1);
expect(clock.timers).to.not.have.key(id);
});
@ -285,7 +285,7 @@ describe('Transport Class', function () {
describe('randomizeHosts options', function () {
it('calls _.shuffle be default', function () {
var _ = require('../../../src/lib/utils');
// var _ = require('../../../src/lib/utils');
stub(Transport.connectionPools.main.prototype, 'setHosts');
stub(_v4, 'shuffle');
var trans = new Transport({
@ -295,7 +295,7 @@ describe('Transport Class', function () {
expect(_v4.shuffle.callCount).to.eql(1);
});
it('skips the call to _.shuffle when false', function () {
var _ = require('../../../src/lib/utils');
// var _ = require('../../../src/lib/utils');
stub(Transport.connectionPools.main.prototype, 'setHosts');
stub(_v4, 'shuffle');
var trans = new Transport({
@ -606,7 +606,7 @@ describe('Transport Class', function () {
}
var trans = new Transport({
hosts: _.map(new Array(retries + 1), function (val, i) {
hosts: _v4.map(new Array(retries + 1), function (val, i) {
return 'localhost/' + i;
}),
maxRetries: retries,
@ -617,7 +617,7 @@ describe('Transport Class', function () {
});
// trigger a select so that we can harvest the connection list
trans.connectionPool.select(_.noop);
trans.connectionPool.select(_v4.noop);
_v4.each(connections, function (conn) {
stub(conn, 'request', failRequest);
});
@ -641,7 +641,7 @@ describe('Transport Class', function () {
it('returns an object with an abort() method when a callback is sent', function () {
var tran = new Transport();
shortCircuitRequest(tran);
var ret = tran.request({}, _.noop);
var ret = tran.request({}, _v4.noop);
expect(ret).to.be.a('object');
expect(ret.abort).to.be.a('function');
});
@ -651,7 +651,7 @@ describe('Transport Class', function () {
var ret = tran.request({});
expect(ret.then).to.be.a('function');
expect(ret.abort).to.be.a('function');
ret.then(_.noop, _.noop); // prevent complaining from bluebird
ret.then(_v4.noop, _v4.noop); // prevent complaining from bluebird
});
it('promise is always pulled from the defer created by this.defer()', function () {
var fakePromise = {};
@ -659,8 +659,8 @@ describe('Transport Class', function () {
var tran = new Transport({
defer: function () {
return {
resolve: _.noop,
reject: _.noop,
resolve: _v4.noop,
reject: _v4.noop,
promise: fakePromise
};
}
@ -759,9 +759,9 @@ describe('Transport Class', function () {
var prom = tran.request({});
// disregard promise, prevent bluebird's warnings
prom.then(_.noop, _.noop);
prom.then(_v4.noop, _v4.noop);
expect(_.size(clock.timers)).to.eql(1);
expect(_v4.size(clock.timers)).to.eql(1);
_v4.each(clock.timers, function (timer, id) {
expect(timer.callAt).to.eql(30000);
clearTimeout(id);
@ -776,9 +776,9 @@ describe('Transport Class', function () {
var prom = tran.request({});
// disregard promise, prevent bluebird's warnings
prom.then(_.noop, _.noop);
prom.then(_v4.noop, _v4.noop);
expect(_.size(clock.timers)).to.eql(1);
expect(_v4.size(clock.timers)).to.eql(1);
_v4.each(clock.timers, function (timer, id) {
expect(timer.callAt).to.eql(5000);
clearTimeout(id);
@ -797,7 +797,7 @@ describe('Transport Class', function () {
requestTimeout: falsy
}, function () {});
expect(_.size(clock.timers)).to.eql(0);
expect(_v4.size(clock.timers)).to.eql(0);
});
});
});

View File

@ -7,7 +7,7 @@ var expect = require('expect.js');
var sinon = require('sinon');
var nock = require('../../mocks/server.js');
var through2 = require('through2');
var _ = require('lodash-migrate');
// var _ = require('lodash');
var nodeList = require('../../fixtures/short_node_list.json');
var stub = require('../../utils/auto_release_stub').make();
@ -277,7 +277,7 @@ describe('Transport + Mock server', function () {
expect(err).to.be(undefined);
expect(resp).to.eql({ i: 'am here' });
expect(status).to.eql(200);
expect(_.keys(clock.timers)).to.have.length(0);
expect(_v4.keys(clock.timers)).to.have.length(0);
clock.restore();
});
});
@ -342,9 +342,9 @@ describe('Transport + Mock server', function () {
.catch(function (err) {
expect(ConnectionPool.prototype._onConnectionDied.callCount).to.eql(1);
expect(tran.sniff.callCount).to.eql(0);
expect(_.size(clock.timers)).to.eql(1);
expect(_v4.size(clock.timers)).to.eql(1);
var timeout = _.values(clock.timers).pop();
var timeout = _v4.values(clock.timers).pop();
timeout.func();
expect(tran.sniff.callCount).to.eql(1);
});

View File

@ -1,4 +1,4 @@
var _ = require('../../../src/lib/utils');
// var _ = require('../../../src/lib/utils');
var expect = require('expect.js');
var stub = require('../../utils/auto_release_stub').make();
@ -6,7 +6,7 @@ var stub = require('../../utils/auto_release_stub').make();
describe('Utils', function () {
describe('Additional Type Checkers', function () {
_.forEach({
_v4.forEach({
Object: {
is: [[], /regexp/]
},
@ -34,66 +34,66 @@ describe('Utils', function () {
function (thing, name) {
describe('#isArrayOf' + name, function () {
it('likes arrays of ' + name, function () {
expect(_['isArrayOf' + name + 's'](thing.is)).to.be(true);
expect(_v4['isArrayOf' + name + 's'](thing.is)).to.be(true);
});
it('dislikes when there is even one non ' + name, function () {
// notice a string in the array
thing.is.push(thing.not || ' not ');
expect(_['isArrayOf' + name + 's'](thing.is)).to.be(false);
expect(_v4['isArrayOf' + name + 's'](thing.is)).to.be(false);
});
});
});
describe('#isNumeric', function () {
it('likes integer literals', function () {
expect(_.isNumeric('-10')).to.be(true);
expect(_.isNumeric('0')).to.be(true);
expect(_.isNumeric('5')).to.be(true);
expect(_.isNumeric(-16)).to.be(true);
expect(_.isNumeric(0)).to.be(true);
expect(_.isNumeric(32)).to.be(true);
expect(_.isNumeric('040')).to.be(true);
expect(_.isNumeric('0xFF')).to.be(true);
expect(_.isNumeric(0xFFF)).to.be(true);
expect(_v4.isNumeric('-10')).to.be(true);
expect(_v4.isNumeric('0')).to.be(true);
expect(_v4.isNumeric('5')).to.be(true);
expect(_v4.isNumeric(-16)).to.be(true);
expect(_v4.isNumeric(0)).to.be(true);
expect(_v4.isNumeric(32)).to.be(true);
expect(_v4.isNumeric('040')).to.be(true);
expect(_v4.isNumeric('0xFF')).to.be(true);
expect(_v4.isNumeric(0xFFF)).to.be(true);
});
it('likes float literals', function () {
expect(_.isNumeric('-1.6')).to.be(true);
expect(_.isNumeric('4.536')).to.be(true);
expect(_.isNumeric(-2.6)).to.be(true);
expect(_.isNumeric(3.1415)).to.be(true);
expect(_.isNumeric(8e5)).to.be(true);
expect(_.isNumeric('123e-2')).to.be(true);
expect(_v4.isNumeric('-1.6')).to.be(true);
expect(_v4.isNumeric('4.536')).to.be(true);
expect(_v4.isNumeric(-2.6)).to.be(true);
expect(_v4.isNumeric(3.1415)).to.be(true);
expect(_v4.isNumeric(8e5)).to.be(true);
expect(_v4.isNumeric('123e-2')).to.be(true);
});
it('dislikes non-numeric stuff', function () {
expect(_.isNumeric('')).to.be(false);
expect(_.isNumeric(' ')).to.be(false);
expect(_.isNumeric('\t\t')).to.be(false);
expect(_.isNumeric('abcdefghijklm1234567890')).to.be(false);
expect(_.isNumeric('xabcdefx')).to.be(false);
expect(_.isNumeric(true)).to.be(false);
expect(_.isNumeric(false)).to.be(false);
expect(_.isNumeric('bcfed5.2')).to.be(false);
expect(_.isNumeric('7.2acdgs')).to.be(false);
expect(_.isNumeric(undefined)).to.be(false);
expect(_.isNumeric(null)).to.be(false);
expect(_.isNumeric(NaN)).to.be(false);
expect(_.isNumeric(Infinity)).to.be(false);
expect(_.isNumeric(Number.POSITIVE_INFINITY)).to.be(false);
expect(_.isNumeric(Number.NEGATIVE_INFINITY)).to.be(false);
expect(_.isNumeric(new Date(2009, 1, 1))).to.be(false);
expect(_.isNumeric([])).to.be(false);
expect(_.isNumeric([1, 2, 3, 4])).to.be(false);
expect(_.isNumeric({})).to.be(false);
expect(_.isNumeric(function () {})).to.be(false);
expect(_v4.isNumeric('')).to.be(false);
expect(_v4.isNumeric(' ')).to.be(false);
expect(_v4.isNumeric('\t\t')).to.be(false);
expect(_v4.isNumeric('abcdefghijklm1234567890')).to.be(false);
expect(_v4.isNumeric('xabcdefx')).to.be(false);
expect(_v4.isNumeric(true)).to.be(false);
expect(_v4.isNumeric(false)).to.be(false);
expect(_v4.isNumeric('bcfed5.2')).to.be(false);
expect(_v4.isNumeric('7.2acdgs')).to.be(false);
expect(_v4.isNumeric(undefined)).to.be(false);
expect(_v4.isNumeric(null)).to.be(false);
expect(_v4.isNumeric(NaN)).to.be(false);
expect(_v4.isNumeric(Infinity)).to.be(false);
expect(_v4.isNumeric(Number.POSITIVE_INFINITY)).to.be(false);
expect(_v4.isNumeric(Number.NEGATIVE_INFINITY)).to.be(false);
expect(_v4.isNumeric(new Date(2009, 1, 1))).to.be(false);
expect(_v4.isNumeric([])).to.be(false);
expect(_v4.isNumeric([1, 2, 3, 4])).to.be(false);
expect(_v4.isNumeric({})).to.be(false);
expect(_v4.isNumeric(function () {})).to.be(false);
});
});
describe('#isInterval', function () {
_.forEach({
_v4.forEach({
M: 'months',
w: 'weeks',
d: 'days',
@ -104,20 +104,20 @@ describe('Utils', function () {
},
function (name, unit) {
it('likes ' + name, function () {
expect(_.isInterval('1' + unit)).to.be(true);
expect(_v4.isInterval('1' + unit)).to.be(true);
});
it('likes decimal ' + name, function () {
expect(_.isInterval('1.5' + unit)).to.be(true);
expect(_v4.isInterval('1.5' + unit)).to.be(true);
});
});
it('dislikes more than one unit', function () {
expect(_.isInterval('1my')).to.be(false);
expect(_v4.isInterval('1my')).to.be(false);
});
it('dislikes spaces', function () {
expect(_.isInterval('1 m')).to.be(false);
expect(_v4.isInterval('1 m')).to.be(false);
});
});
});
@ -127,108 +127,108 @@ describe('Utils', function () {
describe('#camelCase', function () {
it('find spaces, underscores, and other natural word breaks', function () {
expect(_.camelCase('Neil Patrick.Harris-is_a.dog')).to.eql('neilPatrickHarrisIsADog');
expect(_v4.camelCase('Neil Patrick.Harris-is_a.dog')).to.eql('neilPatrickHarrisIsADog');
});
it('ignores abreviations', function () {
expect(_.camelCase('Json_parser')).to.eql('jsonParser');
expect(_v4.camelCase('Json_parser')).to.eql('jsonParser');
});
it('handles leading _', function () {
expect(_.camelCase('_thing_one_')).to.eql('_thingOne');
expect(_v4.camelCase('_thing_one_')).to.eql('_thingOne');
});
it('works on numbers', function () {
expect(_.camelCase('version 1.0')).to.eql('version10');
expect(_v4.camelCase('version 1.0')).to.eql('version10');
});
});
describe('#studlyCase', function () {
it('find spaces, underscores, and other natural word breaks', function () {
expect(_.studlyCase('Neil Patrick.Harris-is_a.dog')).to.eql('NeilPatrickHarrisIsADog');
expect(_v4.studlyCase('Neil Patrick.Harris-is_a.dog')).to.eql('NeilPatrickHarrisIsADog');
});
it('ignores abreviations', function () {
expect(_.studlyCase('Json_parser')).to.eql('JsonParser');
expect(_v4.studlyCase('Json_parser')).to.eql('JsonParser');
});
it('handles leading _', function () {
expect(_.studlyCase('_thing_one_')).to.eql('_ThingOne');
expect(_v4.studlyCase('_thing_one_')).to.eql('_ThingOne');
});
it('works on numbers', function () {
expect(_.studlyCase('version 1.0')).to.eql('Version10');
expect(_v4.studlyCase('version 1.0')).to.eql('Version10');
});
});
describe('#snakeCase', function () {
it('find spaces, underscores, and other natural word breaks', function () {
expect(_.snakeCase('Neil Patrick.Harris-is_a.dog')).to.eql('neil_patrick_harris_is_a_dog');
expect(_v4.snakeCase('Neil Patrick.Harris-is_a.dog')).to.eql('neil_patrick_harris_is_a_dog');
});
it('ignores abreviations', function () {
expect(_.snakeCase('Json_parser')).to.eql('json_parser');
expect(_v4.snakeCase('Json_parser')).to.eql('json_parser');
});
it('handles leading _', function () {
expect(_.snakeCase('_thing_one_')).to.eql('_thing_one');
expect(_v4.snakeCase('_thing_one_')).to.eql('_thing_one');
});
it('works on numbers', function () {
expect(_.snakeCase('version 1.0')).to.eql('version_1_0');
expect(_v4.snakeCase('version 1.0')).to.eql('version_1_0');
});
});
describe('#toLowerString', function () {
it('transforms normal strings', function () {
expect(_.toLowerString('PASTA')).to.eql('pasta');
expect(_v4.toLowerString('PASTA')).to.eql('pasta');
});
it('ignores long form empty vals (null, false, undef)', function () {
expect(_.toLowerString(null)).to.eql('');
expect(_.toLowerString(false)).to.eql('');
expect(_.toLowerString(void 0)).to.eql('');
expect(_v4.toLowerString(null)).to.eql('');
expect(_v4.toLowerString(false)).to.eql('');
expect(_v4.toLowerString(void 0)).to.eql('');
});
it('uses the objects own toString', function () {
expect(_.toLowerString(['A', 'B'])).to.eql('a,b');
expect(_v4.toLowerString(['A', 'B'])).to.eql('a,b');
});
it('sorta kinda works on objects', function () {
expect(_.toLowerString({ a: 'thing' })).to.eql('[object object]');
expect(_v4.toLowerString({ a: 'thing' })).to.eql('[object object]');
});
});
describe('#toUpperString', function () {
it('transforms normal strings', function () {
expect(_.toUpperString('PASTA')).to.eql('PASTA');
expect(_v4.toUpperString('PASTA')).to.eql('PASTA');
});
it('ignores long form empty vals (null, false, undef)', function () {
expect(_.toUpperString(null)).to.eql('');
expect(_.toUpperString(false)).to.eql('');
expect(_.toUpperString(void 0)).to.eql('');
expect(_v4.toUpperString(null)).to.eql('');
expect(_v4.toUpperString(false)).to.eql('');
expect(_v4.toUpperString(void 0)).to.eql('');
});
it('uses the objects own toString', function () {
expect(_.toUpperString(['A', 'B'])).to.eql('A,B');
expect(_v4.toUpperString(['A', 'B'])).to.eql('A,B');
});
it('sorta kinda works on objects', function () {
expect(_.toUpperString({ a: 'thing' })).to.eql('[OBJECT OBJECT]');
expect(_v4.toUpperString({ a: 'thing' })).to.eql('[OBJECT OBJECT]');
});
});
describe('#repeat', function () {
it('repeats strings', function () {
expect(_.repeat(' ', 5)).to.eql(' ');
expect(_.repeat('foobar', 2)).to.eql('foobarfoobar');
expect(_v4.repeat(' ', 5)).to.eql(' ');
expect(_v4.repeat('foobar', 2)).to.eql('foobarfoobar');
});
});
describe('#ucfirst', function () {
it('only capitalized the first letter, lowercases everything else', function () {
expect(_.ucfirst('ALGER')).to.eql('Alger');
expect(_v4.ucfirst('ALGER')).to.eql('Alger');
});
});
@ -241,14 +241,14 @@ describe('Utils', function () {
var obj = {
foo: 'bar'
};
expect(_.deepMerge(obj, { bar: 'baz' })).to.eql(obj);
expect(_v4.deepMerge(obj, { bar: 'baz' })).to.eql(obj);
});
it('concats arrays', function () {
var obj = {
foo: ['bax', 'boz']
};
_.deepMerge(obj, { foo: ['boop'] });
_v4.deepMerge(obj, { foo: ['boop'] });
expect(obj.foo).to.have.length(3);
});
@ -256,7 +256,7 @@ describe('Utils', function () {
var obj = {
foo: ['stop', 'foo', 'stahp']
};
_.deepMerge(obj, { foo: 'string' });
_v4.deepMerge(obj, { foo: 'string' });
expect(obj.foo).to.have.length(3);
});
@ -267,7 +267,7 @@ describe('Utils', function () {
foo: ['bax', 'boz']
}
};
_.deepMerge(obj, { bax: { foo: ['poo'] } });
_v4.deepMerge(obj, { bax: { foo: ['poo'] } });
expect(obj.bax.foo).to.have.length(3);
});
@ -276,26 +276,26 @@ describe('Utils', function () {
describe('#createArray', function () {
it('accepts an array of things and simply returns a copy of it', function () {
var inp = [{ a: 1 }, 'pizza'];
var out = _.createArray(inp);
var out = _v4.createArray(inp);
expect(out).to.eql(inp);
expect(out).to.not.be(inp);
});
it('accepts a primitive value and calls the the transform function', function (done) {
_.createArray('str', function (val) {
_v4.createArray('str', function (val) {
expect(val).to.be('str');
done();
});
});
it('wraps any non-array in an array', function () {
expect(_.createArray({})).to.eql([{}]);
expect(_.createArray('')).to.eql(['']);
expect(_.createArray(123)).to.eql([123]);
expect(_.createArray(/abc/)).to.eql([/abc/]);
expect(_.createArray(false)).to.eql([false]);
expect(_v4.createArray({})).to.eql([{}]);
expect(_v4.createArray('')).to.eql(['']);
expect(_v4.createArray(123)).to.eql([123]);
expect(_v4.createArray(/abc/)).to.eql([/abc/]);
expect(_v4.createArray(false)).to.eql([false]);
});
it('returns false when the transform function returns undefined', function () {
expect(_.createArray(['str', 1], function (val) {
if (_.isString(val)) {
expect(_v4.createArray(['str', 1], function (val) {
if (_v4.isString(val)) {
return {
val: val
};
@ -306,27 +306,27 @@ describe('Utils', function () {
describe('#funcEnum', function () {
/*
* _.funcEnum(object, key, opts, default);
* _v4.funcEnum(object, key, opts, default);
*/
it('tests if the value at key in object is a function, returns it if so', function () {
var config = {
func: function () {}
};
expect(_.funcEnum(config, 'func', {}, 'toString'))
expect(_v4.funcEnum(config, 'func', {}, 'toString'))
.to.be(config.func);
});
it('tests if the value at key in object is undefined, returns the option at key default if so', function () {
var config = {
func: undefined
};
expect(_.funcEnum(config, 'func', {}, 'toString'))
expect(_v4.funcEnum(config, 'func', {}, 'toString'))
.to.be(Object.prototype.toString);
});
it('tests if the value at key in object is a string, returns the option at that key if so', function () {
var config = {
'config key name': 'toString'
};
expect(_.funcEnum(config, 'config key name', { toString: 'pizza' }, 'toJSON'))
expect(_v4.funcEnum(config, 'config key name', { toString: 'pizza' }, 'toJSON'))
.to.be('pizza');
});
it('throws an informative error if the selection if invalid', function () {
@ -335,15 +335,15 @@ describe('Utils', function () {
};
expect(function () {
_.funcEnum(config, 'config', {});
_v4.funcEnum(config, 'config', {});
}).to.throwError(/expected a function/i);
expect(function () {
_.funcEnum(config, 'config', { main: 'default' }, 'main');
_v4.funcEnum(config, 'config', { main: 'default' }, 'main');
}).to.throwError(/expected a function or main/i);
expect(function () {
_.funcEnum(config, 'config', { main: 'default', other: 'default' }, 'main');
_v4.funcEnum(config, 'config', { main: 'default', other: 'default' }, 'main');
}).to.throwError(/expected a function or one of main, other/i);
});
});
@ -358,8 +358,8 @@ describe('Utils', function () {
var func = function () {};
stub(func, method);
var args = _.map(new Array(i), function (val, i) { return i; });
_.applyArgs(func, null, args);
var args = _v4.map(new Array(i), function (val, i) { return i; });
_v4.applyArgs(func, null, args);
expect(func[method].callCount).to.eql(1);
if (method === 'apply') {
@ -374,9 +374,9 @@ describe('Utils', function () {
var func = function () {};
stub(func, method);
var args = _.map(new Array(argCount), function (val, i) { return i; });
var args = _v4.map(new Array(argCount), function (val, i) { return i; });
var expected = args.slice(slice);
_.applyArgs(func, null, args, slice);
_v4.applyArgs(func, null, args, slice);
expect(func[method].callCount).to.eql(1);
if (method === 'apply') {
@ -390,24 +390,24 @@ describe('Utils', function () {
describe('#getUnwrittenFromStream', function () {
it('ignores things that do not have writableState', function () {
expect(_.getUnwrittenFromStream()).to.be(undefined);
expect(_.getUnwrittenFromStream(false)).to.be(undefined);
expect(_.getUnwrittenFromStream([])).to.be(undefined);
expect(_.getUnwrittenFromStream({})).to.be(undefined);
expect(_v4.getUnwrittenFromStream()).to.be(undefined);
expect(_v4.getUnwrittenFromStream(false)).to.be(undefined);
expect(_v4.getUnwrittenFromStream([])).to.be(undefined);
expect(_v4.getUnwrittenFromStream({})).to.be(undefined);
});
if (require('stream').Writable) {
var MockWritableStream = require('../../mocks/writable_stream');
it('ignores empty stream', function () {
var stream = new MockWritableStream();
expect(_.getUnwrittenFromStream(stream)).to.be('');
expect(_v4.getUnwrittenFromStream(stream)).to.be('');
});
it('returns only what is in the buffer', function () {
var stream = new MockWritableStream();
stream.write('hot');
stream.write('dog');
expect(_.getUnwrittenFromStream(stream)).to.be('dog');
expect(_v4.getUnwrittenFromStream(stream)).to.be('dog');
});
}
});

View File

@ -1,7 +1,7 @@
var _ = require('lodash-migrate');
// var _ = require('lodash');
var expect = require('expect.js');
module.exports = function expectSubObject(obj, subObj) {
_.forOwn(subObj, function (val, prop) {
_v4.forOwn(subObj, function (val, prop) {
if (typeof obj[prop] === 'object') {
// non-strict equals
expect(obj[prop]).to.eql(val, 'Expected property' + prop + ' of object to equal ' + val);

View File

@ -7,7 +7,7 @@
module.exports = JenkinsReporter;
var Base = require('mocha/lib/reporters/base');
var _ = require('lodash-migrate');
// var _ = require('lodash');
var chalk = require('chalk');
var makeJUnitXml = require('./make_j_unit_xml');
var fs = require('fs');
@ -15,7 +15,7 @@ var path = require('path');
var inspect = require('util').inspect;
var log = (function () {
var locked = _.bind(process.stdout.write, process.stdout);
var locked = _v4.bind(process.stdout.write, process.stdout);
return function (str) {
if (typeof str !== 'string') {
str = inspect(str);
@ -126,7 +126,7 @@ function JenkinsReporter(runner) {
errMsg += '\n(' + test.err.sourceURL + ':' + test.err.line + ')';
}
console.error(_.map(errMsg.split('\n'), function (line) {
console.error(_v4.map(errMsg.split('\n'), function (line) {
return indt() + ' ' + line;
}).join('\n'));
}
@ -146,7 +146,7 @@ function JenkinsReporter(runner) {
runner.on('hook end', function (hook) {
if (hook.title.indexOf('"after each"') > -1 && stack[0] && stack[0].results.length) {
var result = _.last(stack[0].results);
var result = _v4.last(stack[0].results);
result.stdout += stack[0].stdout;
result.stderr += stack[0].stderr;
stack[0].stdout = stack[0].stderr = '';
@ -157,7 +157,7 @@ function JenkinsReporter(runner) {
restoreStdio();
var xml = makeJUnitXml('node ' + process.version, {
stats: stats,
suites: _.map(rootSuite.suites, function removeElements(suite) {
suites: _v4.map(rootSuite.suites, function removeElements(suite) {
var s = {
name: suite.name,
start: suite.start,
@ -168,7 +168,7 @@ function JenkinsReporter(runner) {
};
if (suite.suites) {
s.suites = _.map(suite.suites, removeElements);
s.suites = _v4.map(suite.suites, removeElements);
}
return s;
})

View File

@ -28,7 +28,7 @@ var testXml = require('xmlbuilder');
var suites = testXml.create('testsuites');
var suiteCount = 0;
var moment = require('moment');
var _ = require('lodash-migrate');
// var _ = require('lodash');
var chalk = require('chalk');
function makeJUnitXml(runnerName, testDetails) {
@ -41,7 +41,7 @@ function makeJUnitXml(runnerName, testDetails) {
timestamp: moment(suiteInfo.start).toJSON(),
hostname: 'localhost',
tests: (suiteInfo.results && suiteInfo.results.length) || 0,
failures: _.where(suiteInfo.results, { pass: false }).length,
failures: _v4.filter(suiteInfo.results, { pass: false }).length,
errors: 0,
time: suiteInfo.time / 1000
});

View File

@ -2,7 +2,7 @@
var express = require('express');
var http = require('http');
var fs = require('fs');
var _ = require('lodash-migrate');
// var _ = require('lodash');
var async = require('async');
var root = require('path').join(__dirname, '../..');
var browserify = require('browserify');
@ -12,7 +12,7 @@ var browserBuildsDir = root + '/test/unit/browser_builds';
var testFiles = {};
testFiles.unit = _(fs.readdirSync(unitSpecDir))
testFiles.unit = _v4(fs.readdirSync(unitSpecDir))
.difference([
'file_logger.js',
'http_connector.js',