Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #596 from gemini-testing/lodash-4.x
Browse files Browse the repository at this point in the history
Update lodash to 4.x.x
  • Loading branch information
rostik404 authored Sep 15, 2016
2 parents 63221aa + 221e1ff commit c970c52
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/browser-pool/per-browser-limited-pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ module.exports = class PerBrowserLimitedPool extends Pool {

cancel() {
log('cancel');
_.each(this._browserPools, (pool) => pool.cancel());
_.forEach(this._browserPools, (pool) => pool.cancel());
}
};
6 changes: 3 additions & 3 deletions lib/cli/deprecations.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ exports.checkForDeprecations = function() {
};

function checkForRemovedOptions() {
_.each(REMOVED_OPTIONS_REPLACEMENTS, function(replacement, option) {
if (_.contains(process.argv, option)) {
_.forEach(REMOVED_OPTIONS_REPLACEMENTS, function(replacement, option) {
if (_.includes(process.argv, option)) {
throw new GeminiError(
util.format('Option %s is removed', option),
'Instead use ' + replacement
Expand All @@ -39,7 +39,7 @@ function checkForRemovedOptions() {
}

function checkForRemovedEnvVars() {
_.each(REMOVED_ENV_REPLACEMENTS, function(replacement, option) {
_.forEach(REMOVED_ENV_REPLACEMENTS, function(replacement, option) {
if (option in process.env) {
console.warn(
'WARNING: %s env var is not longer used. Use %s instead',
Expand Down
6 changes: 3 additions & 3 deletions lib/coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = inherit({
},

addStatsForBrowser: function(stats, browserId) {
_.each(stats, function(coverage, url) {
_.forEach(stats, function(coverage, url) {
if (coverage.ignored) {
this._warnInnacurate(url, coverage.message);
return;
Expand All @@ -35,7 +35,7 @@ module.exports = inherit({
sourceFile: this._urlToFilePath(url, browserId),
coverage: {}
};
_.assign(this.byURL[url].coverage, coverage, coverageLevel.merge);
_.assignWith(this.byURL[url].coverage, coverage, coverageLevel.merge);
}.bind(this));
},

Expand Down Expand Up @@ -135,7 +135,7 @@ module.exports = inherit({
}

var base64Prefix = 'data:application/json;base64,';
if (_.contains(sourceMapUrl, base64Prefix)) {
if (_.includes(sourceMapUrl, base64Prefix)) {
var base64Str = sourceMapUrl.split(base64Prefix)[1],
sourceMapStr = new Buffer(base64Str, 'base64').toString('utf8');
return new SourceMapConsumer(JSON.parse(sourceMapStr));
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var prefix = 'gemini-';
module.exports = {
load: function(gemini, options) {
_.chain(options.system.plugins)
.pairs()
.toPairs()
.map(function(pair) {
return {name: pair[0], opts: pair[1]};
})
Expand Down
6 changes: 3 additions & 3 deletions lib/reporters/html/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = {
currentPath: currentPath,
diffPath: diffPath,

referenceAbsolutePath: _.compose(absolutePath, referencePath),
currentAbsolutePath: _.compose(absolutePath, currentPath),
diffAbsolutePath: _.compose(absolutePath, diffPath)
referenceAbsolutePath: _.flowRight(absolutePath, referencePath),
currentAbsolutePath: _.flowRight(absolutePath, currentPath),
diffAbsolutePath: _.flowRight(absolutePath, diffPath)
};
2 changes: 1 addition & 1 deletion lib/runner/browser-runner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var BrowserRunner = inherit(Runner, {

return _(suites)
.filter(function(suite) {
return _.contains(suite.browsers, _this._browserId);
return _.includes(suite.browsers, _this._browserId);
})
.map(function(suite) {
return _this._tryToRunSuite(suite, stateProcessor);
Expand Down
2 changes: 1 addition & 1 deletion lib/runner/state-runner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const DisabledStateRunner = require('./disabled-state-runner');
const _ = require('lodash');

exports.create = (state, browserSession, config) => {
if (!_.contains(state.browsers, browserSession.browser.id)) {
if (!_.includes(state.browsers, browserSession.browser.id)) {
return new DisabledStateRunner(state, browserSession, config);
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"inherit": "~2.2.1",
"install": "^0.6.1",
"js-yaml": "^3.2.5",
"lodash": "^3.10.1",
"lodash": "^4.15.0",
"looks-same": "^3.0.0",
"minimatch": "^3.0.0",
"png-img": "^2.1.0",
Expand Down
12 changes: 12 additions & 0 deletions test/unit/coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,17 @@ describe('coverage', () => {

assert.calledWith(path.resolve, 'source/root', 'rel/path');
});

it('should correctly merge a coverage level', () => {
const config = createConfig();
const coverage = new Coverage(config);

coverage.byURL['http://some/url'] = {
coverage: {'.some-selector': 'full'}
};
coverage.addStatsForBrowser({'http://some/url': {'.some-selector': 'none'}});

assert.deepEqual(coverage.byURL['http://some/url'].coverage, {'.some-selector': 'full'});
});
});
});
2 changes: 1 addition & 1 deletion test/unit/reporters/flat-factory/flat.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('Reporter#Flat', () => {

return _(chunks)
.map((val) => val.toLowerCase().split(/:\s/))
.zipObject()
.fromPairs()
.value();
};

Expand Down

0 comments on commit c970c52

Please sign in to comment.