From c7f6c09d8c15502dffcf2add84d39446e1476a1e Mon Sep 17 00:00:00 2001 From: spalger Date: Thu, 19 May 2016 09:09:31 -0700 Subject: [PATCH] get the unit tests to pass --- grunt/config/mochacov.js | 2 +- grunt/utils.js | 26 +++++++++---------- scripts/ci.js | 2 +- scripts/generate/js_api.js | 1 - scripts/generate/templates/api_file.tmpl | 4 +-- scripts/generate/templates/client_action.tmpl | 4 +-- .../templates/client_action_proxy.tmpl | 4 +-- scripts/generate/templates/index.js | 1 - src/lib/client.js | 8 +++--- src/lib/client_action.js | 2 +- src/lib/connection_pool.js | 4 +-- src/lib/connectors/browser_index.js | 2 +- src/lib/connectors/http.js | 8 +++--- src/lib/errors.js | 2 +- src/lib/host.js | 6 ++--- src/lib/log.js | 4 +-- src/lib/logger.js | 8 +++--- src/lib/transport.js | 4 +-- src/lib/utils.js | 6 ++--- test/integration/yaml_suite/yaml_doc.js | 2 +- test/mocks/browser_http.js | 4 +-- test/unit/buffer_flush_tests.js | 1 - test/unit/specs/client_action.js | 2 +- test/unit/specs/connection_pool.js | 4 +-- test/unit/specs/errors.js | 2 +- test/unit/specs/file_logger.js | 1 - test/unit/specs/random_selector.js | 1 - test/unit/specs/round_robin_selector.js | 3 +-- test/unit/specs/stream_logger.js | 1 - test/unit/specs/transport.js | 17 ++++++------ test/utils/make_j_unit_xml.js | 6 ++--- 31 files changed, 67 insertions(+), 75 deletions(-) diff --git a/grunt/config/mochacov.js b/grunt/config/mochacov.js index eec8f7d6e..dd896a0a7 100644 --- a/grunt/config/mochacov.js +++ b/grunt/config/mochacov.js @@ -78,4 +78,4 @@ grunt.registerTask('mocha_jenkins_integration', function (branch) { grunt.task.run('mochacov:jenkins_integration'); }); -module.exports = config; \ No newline at end of file +module.exports = config; diff --git a/grunt/utils.js b/grunt/utils.js index 8a3405c67..a880791b6 100644 --- a/grunt/utils.js +++ b/grunt/utils.js @@ -31,19 +31,19 @@ utils.minorVersion = function (version) { utils.increaseVersion = function (version, type) { var i; switch (type) { - case 'major': - i = 0; - break; - case 'minor': - i = 1; - break; - case 'bug': - case 'patch': - case 'bugfix': - i = 2; - break; - default: - throw new TypeError('unexpected version bump type'); + case 'major': + i = 0; + break; + case 'minor': + i = 1; + break; + case 'bug': + case 'patch': + case 'bugfix': + i = 2; + break; + default: + throw new TypeError('unexpected version bump type'); } // breakout the current version diff --git a/scripts/ci.js b/scripts/ci.js index b1e35c405..1ea221f0e 100644 --- a/scripts/ci.js +++ b/scripts/ci.js @@ -30,7 +30,7 @@ var format = require('util').format; var NL_RE = /(\r?\n)/g; var ROOT = join(__dirname, '..'); var GRUNT = join(ROOT, 'node_modules', '.bin', 'grunt'); -var ENV = _.clone(process.env); +var ENV = _v4.clone(process.env); var JENKINS = !!ENV.JENKINS_HOME; var TASKS = []; diff --git a/scripts/generate/js_api.js b/scripts/generate/js_api.js index f374b003f..a9a2da981 100644 --- a/scripts/generate/js_api.js +++ b/scripts/generate/js_api.js @@ -4,7 +4,6 @@ module.exports = function (branch, done) { * @type {[type]} */ var _ = require('../../src/lib/utils'); - var _v4 = require('lodash-migrate/lodash'); var utils = require('../../grunt/utils'); var fs = require('fs'); var async = require('async'); diff --git a/scripts/generate/templates/api_file.tmpl b/scripts/generate/templates/api_file.tmpl index b0c730253..11797a2e5 100644 --- a/scripts/generate/templates/api_file.tmpl +++ b/scripts/generate/templates/api_file.tmpl @@ -9,7 +9,7 @@ var api = module.exports = {}; api._namespaces = <%= stringify(namespaces) %>;<% -_.each(actions, function (action) { +_v4.each(actions, function (action) { var namespace = action.location.split('.').shift(); if (_.includes(namespaces, namespace)) { _.pull(namespaces, namespace); @@ -22,7 +22,7 @@ api.<%= namespace %> = namespace();<% }); -_.each(proxies, function (action) {%> +_v4.each(proxies, function (action) {%> <%= partials.client_action_proxy(action) %><% }); diff --git a/scripts/generate/templates/client_action.tmpl b/scripts/generate/templates/client_action.tmpl index 4a80b7f0f..490e19652 100644 --- a/scripts/generate/templates/client_action.tmpl +++ b/scripts/generate/templates/client_action.tmpl @@ -2,11 +2,11 @@ * Perform a [<%= name %>](<%= docUrl %>) request * * @param {Object} params - An object with parameters used to carry out this action<% -_.each(allParams, function(param, paramName) { %> +_v4.each(allParams, function(param, paramName) { %> * @param {<%= paramType(param.type) %>} <%= paramWithDefault('params.' + paramName, param.default) %><% if (param.description) { %> - <%= param.description %><% } %><% }) %> */ -api<%= (location[0] === '[' ? '' : '.') + location %> = ca(<%= stringify(spec, true) %>); \ No newline at end of file +api<%= (location[0] === '[' ? '' : '.') + location %> = ca(<%= stringify(spec, true) %>); diff --git a/scripts/generate/templates/client_action_proxy.tmpl b/scripts/generate/templates/client_action_proxy.tmpl index f5dd98929..b122028b2 100644 --- a/scripts/generate/templates/client_action_proxy.tmpl +++ b/scripts/generate/templates/client_action_proxy.tmpl @@ -2,7 +2,7 @@ * Perform a [<%= name %>](<%= docUrl %>) request * * @param {Object} params - An object with parameters used to carry out this action<% -_.each(allParams, function(param, paramName) { %> +_v4.each(allParams, function(param, paramName) { %> * @param {<%= paramType(param.type) %>} <%= paramWithDefault('params.' + paramName, param.default) %><% if (param.description) { %> - <%= param.description %><% @@ -16,4 +16,4 @@ if (typeof transformBody === 'string') { %>, { } }<% } -%>); \ No newline at end of file +%>); diff --git a/scripts/generate/templates/index.js b/scripts/generate/templates/index.js index 0f74000af..fc555c3b9 100644 --- a/scripts/generate/templates/index.js +++ b/scripts/generate/templates/index.js @@ -1,6 +1,5 @@ var _ = require('../../../src/lib/utils'); -var _v4 = require('lodash-migrate/lodash'); var utils = require('../../../grunt/utils'); var fs = require('fs'); var path = require('path'); diff --git a/src/lib/client.js b/src/lib/client.js index c29e2e4cb..e9b2321ed 100755 --- a/src/lib/client.js +++ b/src/lib/client.js @@ -56,11 +56,11 @@ function Client(config) { this.transport = new Transport(config); - _.each(EsApiClient.prototype, function (Fn, prop) { + _v4.each(EsApiClient.prototype, _.bind(function (Fn, prop) { if (Fn.prototype instanceof clientAction.ApiNamespace) { this[prop] = new Fn(this.transport); } - }, this); + }, this)); delete this._namespaces; } @@ -74,9 +74,9 @@ function Client(config) { var Constructor = EsApiClient; if (config.plugins) { - Constructor.prototype = _.cloneDeep(Constructor.prototype); + Constructor.prototype = _v4.cloneDeep(Constructor.prototype); - _.each(config.plugins, function (setup) { + _v4.each(config.plugins, function (setup) { Constructor = setup(Constructor, config, { apis: require('./apis'), connectors: require('./connectors'), diff --git a/src/lib/client_action.js b/src/lib/client_action.js index e6596eb0e..6b34e2e6f 100644 --- a/src/lib/client_action.js +++ b/src/lib/client_action.js @@ -57,7 +57,7 @@ function makeFactoryWithModifier(modifier) { } try { - return exec(this.transport, spec, _.clone(params), cb); + return exec(this.transport, spec, _v4.clone(params), cb); } catch (e) { if (typeof cb === 'function') { _.nextTick(cb, e); diff --git a/src/lib/connection_pool.js b/src/lib/connection_pool.js index 87c6dfcb9..7a892cd48 100644 --- a/src/lib/connection_pool.js +++ b/src/lib/connection_pool.js @@ -257,7 +257,7 @@ ConnectionPool.prototype.getConnections = function (status, limit) { if (limit == null) { return list.slice(0); } else { - return _.shuffle(list).slice(0, limit); + return _v4.shuffle(list).slice(0, limit); } }; @@ -308,7 +308,7 @@ ConnectionPool.prototype.setHosts = function (hosts) { var i; var id; var host; - var toRemove = _.clone(this.index); + var toRemove = _v4.clone(this.index); for (i = 0; i < hosts.length; i++) { host = hosts[i]; diff --git a/src/lib/connectors/browser_index.js b/src/lib/connectors/browser_index.js index 8553ee8da..ad47d6253 100644 --- a/src/lib/connectors/browser_index.js +++ b/src/lib/connectors/browser_index.js @@ -6,7 +6,7 @@ var opts = { var _ = require('../utils'); // remove modules that have been ignored by browserify -_.each(opts, function (conn, name) { +_v4.each(opts, function (conn, name) { if (typeof conn !== 'function') { delete opts[name]; } diff --git a/src/lib/connectors/http.js b/src/lib/connectors/http.js index 041b1bf5c..7bb742683 100644 --- a/src/lib/connectors/http.js +++ b/src/lib/connectors/http.js @@ -53,7 +53,7 @@ HttpConnector.prototype.onStatusSet = _.handler(function (status) { var agent = this.agent; var toRemove = []; var collectSockets = function (sockets, host) { - _.each(sockets, function (s) { + _v4.each(sockets, function (s) { if (s) toRemove.push([host, s]); }); }; @@ -61,9 +61,9 @@ HttpConnector.prototype.onStatusSet = _.handler(function (status) { agent.minSockets = agent.maxSockets = 0; agent.requests = {}; - _.each(agent.sockets, collectSockets); - _.each(agent.freeSockets, collectSockets); - _.each(toRemove, function (args) { + _v4.each(agent.sockets, collectSockets); + _v4.each(agent.freeSockets, collectSockets); + _v4.each(toRemove, function (args) { var host = args[0], socket = args[1]; agent.removeSocket(socket, host); socket.destroy(); diff --git a/src/lib/errors.js b/src/lib/errors.js index 47139354f..1f2273d57 100644 --- a/src/lib/errors.js +++ b/src/lib/errors.js @@ -137,7 +137,7 @@ var statusCodes = [ [510, 'Not Extended'] ]; -_.each(statusCodes, function createStatusCodeError(tuple) { +_v4.each(statusCodes, function createStatusCodeError(tuple) { var status = tuple[0]; var names = tuple[1]; var allNames = [].concat(names, status); diff --git a/src/lib/host.js b/src/lib/host.js index cdb2f10e7..21cdee433 100644 --- a/src/lib/host.js +++ b/src/lib/host.js @@ -46,7 +46,7 @@ Host.defaultPorts = { }; function Host(config, globalConfig) { - config = _.clone(config || {}); + config = _v4.clone(config || {}); globalConfig = globalConfig || {}; // defaults @@ -85,7 +85,7 @@ function Host(config, globalConfig) { if (_.isObject(config)) { // move hostname/portname to host/port semi-intelligently. - _.each(simplify, function (to) { + _v4.each(simplify, function (to) { var from = to + 'name'; if (config[from] && config[to]) { if (config[to].indexOf(config[from]) === 0) { @@ -107,7 +107,7 @@ function Host(config, globalConfig) { } _.forOwn(config, function (val, prop) { - if (val != null) this[prop] = _.clone(val); + if (val != null) this[prop] = _v4.clone(val); }, this); // make sure the query string is parsed diff --git a/src/lib/log.js b/src/lib/log.js index a463bccf0..9baa30dce 100644 --- a/src/lib/log.js +++ b/src/lib/log.js @@ -176,7 +176,7 @@ Log.parseLevels = function (input) { * @method join * @static * @private - * @param {*} arrayish - An array like object that can be itterated by _.each + * @param {*} arrayish - An array like object that can be itterated by _v4.each * @return {String} - The final string. */ Log.join = function (arrayish) { @@ -289,7 +289,7 @@ Log.normalizeTraceArgs = function (method, requestUrl, body, responseBody, respo if (typeof requestUrl === 'string') { requestUrl = url.parse(requestUrl, true, true); } else { - requestUrl = _.clone(requestUrl); + requestUrl = _v4.clone(requestUrl); if (requestUrl.path) { requestUrl.query = url.parse(requestUrl.path, true, false).query; } diff --git a/src/lib/logger.js b/src/lib/logger.js index 35f8f07e1..e466fec11 100644 --- a/src/lib/logger.js +++ b/src/lib/logger.js @@ -64,7 +64,7 @@ LoggerAbstract.prototype.setupListeners = function (levels) { this.listeningLevels = []; - _.each(levels, function (level) { + _v4.each(levels, _.bind(function (level) { var fnName = 'on' + _.ucfirst(level); if (this.bound[fnName]) { this.listeningLevels.push(level); @@ -72,7 +72,7 @@ LoggerAbstract.prototype.setupListeners = function (levels) { } else { throw new Error('Unable to listen for level "' + level + '"'); } - }, this); + }, this)); }; /** @@ -83,9 +83,9 @@ LoggerAbstract.prototype.setupListeners = function (levels) { * @return {undefined} */ LoggerAbstract.prototype.cleanUpListeners = _.handler(function () { - _.each(this.listeningLevels, function (level) { + _v4.each(this.listeningLevels, _.bind(function (level) { this.log.removeListener(level, this.bound['on' + _.ucfirst(level)]); - }, this); + }, this)); }); /** diff --git a/src/lib/transport.js b/src/lib/transport.js index 452782372..88c559573 100644 --- a/src/lib/transport.js +++ b/src/lib/transport.js @@ -62,7 +62,7 @@ function Transport(config) { } if (randomizeHosts) { - hostsConfig = _.shuffle(hostsConfig); + hostsConfig = _v4.shuffle(hostsConfig); } self.setHosts(hostsConfig); @@ -439,7 +439,7 @@ Transport.prototype.setHosts = function (hostsConfigs) { Transport.prototype.close = function () { this.log.close(); this.closed = true; - _.each(this._timers, clearTimeout); + _v4.each(this._timers, clearTimeout); this._timers = null; this.connectionPool.close(); }; diff --git a/src/lib/utils.js b/src/lib/utils.js index 69c5f9f3e..1f4247066 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -32,7 +32,7 @@ utils.joinPath = path.join; * @return {Object} - returns the modified to value */ utils.deepMerge = function (to, from) { - _.each(from, function (fromVal, key) { + _v4.each(from, function (fromVal, key) { switch (typeof to[key]) { case 'undefined': to[key] = from[key]; @@ -56,7 +56,7 @@ utils.deepMerge = function (to, from) { * @param {Array} arr - An array to check * @return {Boolean} */ -_.each([ +_v4.each([ 'String', 'Object', 'PlainObject', @@ -404,7 +404,7 @@ _.getUnwrittenFromStream = function (stream) { var out = ''; if (!writeBuffer.length) return out; - _.each(writeBuffer, function (writeReq) { + _v4.each(writeBuffer, function (writeReq) { if (writeReq.chunk) { // 0.9.12+ uses WriteReq objects with a chunk prop out += '' + writeReq.chunk; diff --git a/test/integration/yaml_suite/yaml_doc.js b/test/integration/yaml_suite/yaml_doc.js index 7e6ef635c..77dd1c348 100644 --- a/test/integration/yaml_suite/yaml_doc.js +++ b/test/integration/yaml_suite/yaml_doc.js @@ -568,7 +568,7 @@ YamlDoc.prototype = { // recursively replace all $var within args _.forOwn(args, function recurse(val, key, lvl) { if (_.isObject(val)) { - return _.each(val, recurse); + return _v4.each(val, recurse); } if (_.isString(val)) { diff --git a/test/mocks/browser_http.js b/test/mocks/browser_http.js index 00d6cdb8b..912de0fe5 100644 --- a/test/mocks/browser_http.js +++ b/test/mocks/browser_http.js @@ -221,7 +221,7 @@ MockHttpRequest.prototype = { getAllResponseHeaders: function () { var r = ''; - _.each(this.responseHeaders, function (header) { + _v4.each(this.responseHeaders, function (header) { if ((header === 'set-cookie') || (header === 'set-cookie2')) { return; } @@ -353,7 +353,7 @@ MockHttpRequest.prototype = { this.responseText = null; this.error = true; - _.each(this.requestHeaders, function (header) { + _v4.each(this.requestHeaders, function (header) { delete this.requestHeaders[header]; }, this); diff --git a/test/unit/buffer_flush_tests.js b/test/unit/buffer_flush_tests.js index 59ccef5f5..5f70928e0 100644 --- a/test/unit/buffer_flush_tests.js +++ b/test/unit/buffer_flush_tests.js @@ -4,7 +4,6 @@ module.exports = function (makeLogger) { var fs = require('fs'); var once = require('events').EventEmitter.prototype.once; var _ = require('lodash-migrate'); - var _v4 = require('lodash-migrate/lodash'); describe('buffer flush', function () { if (require('stream').Writable) { diff --git a/test/unit/specs/client_action.js b/test/unit/specs/client_action.js index 82f4be8a0..ae49068aa 100644 --- a/test/unit/specs/client_action.js +++ b/test/unit/specs/client_action.js @@ -68,7 +68,7 @@ describe('Client Action runner', function () { afterEach(function () { _stash = {}; }); var make = function (params) { _stash.orig = params; - _stash.copy = _.clone(params); + _stash.copy = _v4.clone(params); return params; }; make.check = function () { diff --git a/test/unit/specs/connection_pool.js b/test/unit/specs/connection_pool.js index ccfd73261..91772d76e 100644 --- a/test/unit/specs/connection_pool.js +++ b/test/unit/specs/connection_pool.js @@ -175,10 +175,10 @@ describe('Connection Pool', function () { new ConnectionAbstract(new Host('http://localhost:9202')), new ConnectionAbstract(new Host('http://localhost:9203')) ]; - var pingQueue = _.shuffle(connections); + var pingQueue = _v4.shuffle(connections); var expectedSelection = pingQueue[pingQueue.length - 1]; - _.each(pingQueue, function (conn) { + _v4.each(pingQueue, function (conn) { pool.addConnection(conn); stub(conn, 'ping', function (params, cb) { if (typeof params === 'function') { diff --git a/test/unit/specs/errors.js b/test/unit/specs/errors.js index 0347b7b4e..12c707099 100644 --- a/test/unit/specs/errors.js +++ b/test/unit/specs/errors.js @@ -2,7 +2,7 @@ var errors = require('../../../src/lib/errors'); var expect = require('expect.js'); var _ = require('lodash-migrate'); -_.each(errors, function (CustomError, name) { +_v4.each(errors, function (CustomError, name) { if (name.charAt(0) !== '_') { describe(name, function () { it('extend the ErrorAbstract and Error classes', function () { diff --git a/test/unit/specs/file_logger.js b/test/unit/specs/file_logger.js index 23ccf1007..cb5a862d0 100644 --- a/test/unit/specs/file_logger.js +++ b/test/unit/specs/file_logger.js @@ -3,7 +3,6 @@ describe('File Logger', function () { var FileLogger = require('../../../src/lib/loggers/file'); var once = require('events').EventEmitter.prototype.once; var _ = require('../../../src/lib/utils'); - var _v4 = require('lodash-migrate/lodash'); var parentLog; var logger; var expect = require('expect.js'); diff --git a/test/unit/specs/random_selector.js b/test/unit/specs/random_selector.js index 2e38ff851..7b7df3149 100644 --- a/test/unit/specs/random_selector.js +++ b/test/unit/specs/random_selector.js @@ -1,7 +1,6 @@ describe('Random Selector', function () { var randomSelector = require('../../../src/lib/selectors/random'); var _ = require('lodash-migrate'); - var _v4 = require('lodash-migrate/lodash'); var expect = require('expect.js'); it('chooses a selection by random', function () { diff --git a/test/unit/specs/round_robin_selector.js b/test/unit/specs/round_robin_selector.js index a7b0b80b1..58d5ec8fe 100644 --- a/test/unit/specs/round_robin_selector.js +++ b/test/unit/specs/round_robin_selector.js @@ -1,12 +1,11 @@ describe('Round Robin Selector', function () { var selector = require('../../../src/lib/selectors/round_robin'); var _ = require('lodash-migrate'); - var _v4 = require('lodash-migrate/lodash'); var expect = require('expect.js'); it('chooses options in order', function () { var options = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]; - var expected = _.clone(options); + var expected = _v4.clone(options); var selections = []; _v4.times(options.length, function () { diff --git a/test/unit/specs/stream_logger.js b/test/unit/specs/stream_logger.js index 49cade3db..44413ad63 100644 --- a/test/unit/specs/stream_logger.js +++ b/test/unit/specs/stream_logger.js @@ -5,7 +5,6 @@ describe('Stream Logger', function () { var once = require('events').EventEmitter.prototype.once; var stream = new MockWritableStream(); var _ = require('../../../src/lib/utils'); - var _v4 = require('lodash-migrate/lodash'); var expect = require('expect.js'); var parentLog; diff --git a/test/unit/specs/transport.js b/test/unit/specs/transport.js index a851beee8..5e2f81e56 100644 --- a/test/unit/specs/transport.js +++ b/test/unit/specs/transport.js @@ -5,7 +5,6 @@ var errors = require('../../../src/lib/errors'); var sinon = require('sinon'); var expect = require('expect.js'); var _ = require('lodash-migrate'); -var _v4 = require('lodash-migrate/lodash'); var nodeList = require('../../fixtures/short_node_list.json'); var stub = require('../../utils/auto_release_stub').make(); @@ -288,23 +287,23 @@ describe('Transport Class', function () { it('calls _.shuffle be default', function () { var _ = require('../../../src/lib/utils'); stub(Transport.connectionPools.main.prototype, 'setHosts'); - stub(_, 'shuffle'); + stub(_v4, 'shuffle'); var trans = new Transport({ hosts: 'localhost' }); - expect(_.shuffle.callCount).to.eql(1); + expect(_v4.shuffle.callCount).to.eql(1); }); it('skips the call to _.shuffle when false', function () { var _ = require('../../../src/lib/utils'); stub(Transport.connectionPools.main.prototype, 'setHosts'); - stub(_, 'shuffle'); + stub(_v4, 'shuffle'); var trans = new Transport({ hosts: 'localhost', randomizeHosts: false }); - expect(_.shuffle.callCount).to.eql(0); + expect(_v4.shuffle.callCount).to.eql(0); }); }); }); @@ -619,7 +618,7 @@ describe('Transport Class', function () { // trigger a select so that we can harvest the connection list trans.connectionPool.select(_.noop); - _.each(connections, function (conn) { + _v4.each(connections, function (conn) { stub(conn, 'request', failRequest); }); @@ -763,7 +762,7 @@ describe('Transport Class', function () { prom.then(_.noop, _.noop); expect(_.size(clock.timers)).to.eql(1); - _.each(clock.timers, function (timer, id) { + _v4.each(clock.timers, function (timer, id) { expect(timer.callAt).to.eql(30000); clearTimeout(id); }); @@ -780,14 +779,14 @@ describe('Transport Class', function () { prom.then(_.noop, _.noop); expect(_.size(clock.timers)).to.eql(1); - _.each(clock.timers, function (timer, id) { + _v4.each(clock.timers, function (timer, id) { expect(timer.callAt).to.eql(5000); clearTimeout(id); }); }); - _.each([false, 0, null], function (falsy) { + _v4.each([false, 0, null], function (falsy) { it('skips the timeout when it is ' + falsy, function () { var clock = sinon.useFakeTimers(); stub.autoRelease(clock); diff --git a/test/utils/make_j_unit_xml.js b/test/utils/make_j_unit_xml.js index f8a800e99..8d5dbbe3e 100644 --- a/test/utils/make_j_unit_xml.js +++ b/test/utils/make_j_unit_xml.js @@ -32,7 +32,7 @@ var _ = require('lodash-migrate'); var chalk = require('chalk'); function makeJUnitXml(runnerName, testDetails) { - _.each(testDetails.suites, function serializeSuite(suiteInfo) { + _v4.each(testDetails.suites, function serializeSuite(suiteInfo) { var suite = suites.ele('testsuite', { package: 'elasticsearch-js', @@ -46,7 +46,7 @@ function makeJUnitXml(runnerName, testDetails) { time: suiteInfo.time / 1000 }); - _.each(suiteInfo.results, function (testInfo) { + _v4.each(suiteInfo.results, function (testInfo) { var section; var integration = false; @@ -83,7 +83,7 @@ function makeJUnitXml(runnerName, testDetails) { }); if (suiteInfo.suites) { - _.each(suiteInfo.suites, serializeSuite); + _v4.each(suiteInfo.suites, serializeSuite); } giveOutput(suite, suiteInfo);