Skip to content

Commit

Permalink
eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
STAFYNIAK Sacha committed Jun 19, 2017
1 parent 7e91896 commit 07baed7
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Expand Up @@ -59,4 +59,4 @@
"sourceType": "module"
},
"extends": "eslint:recommended"
}
}
24 changes: 12 additions & 12 deletions lib/api/core/hotelClerk.js
Expand Up @@ -247,7 +247,7 @@ class HotelClerk {
throw new BadRequestError('The rooms attribute must be an array');
}

const
const
{index, collection} = request.input.resource,
rooms = request.input.body.rooms,
partialErrors = this._removeListRoomsInCollection(index, collection, rooms);
Expand Down Expand Up @@ -349,17 +349,17 @@ class HotelClerk {
collection,
formattedFilters
})
.then(modified => {
this.rooms[modified.roomId] = {
id: modified.roomId,
customers: new Set(),
index: modified.index,
channels: {},
collection: modified.collection
};

return {diff, roomId};
});
.then(modified => {
this.rooms[modified.roomId] = {
id: modified.roomId,
customers: new Set(),
index: modified.index,
channels: {},
collection: modified.collection
};

return {diff, roomId};
});
});
}

Expand Down
9 changes: 4 additions & 5 deletions lib/api/core/plugins/pluginsManager.js
Expand Up @@ -116,7 +116,7 @@ class PluginsManager {
}
}
else {
console.warn(`no object found for plugin ${plugin}`); // eslint-disable-line no-console
console.warn(`no object found for plugin ${plugin}`); // eslint-disable-line no-console
}

pluginConfiguration[plugin] = p;
Expand Down Expand Up @@ -381,7 +381,7 @@ function pm2Init (workers, pluginsWorker, kuzzleConfig) {
}
}, err => {
if (err) {
console.error(`ERROR: Unable to send data to plugin ${pluginName}: ${err.message}`, err.stack); // eslint-disable-line no-console
console.error(`ERROR: Unable to send data to plugin ${pluginName}: ${err.message}`, err.stack); // eslint-disable-line no-console
}
});
});
Expand Down Expand Up @@ -932,10 +932,9 @@ function injectAuthentication(kuzzle, authentications, plugin, pluginName) {
resolve(plugin[strategy.methods[methodName]].bind(plugin)(...args));
}
catch (error) {
reject(error);
reject(error instanceof KuzzleError ? error : new PluginImplementationError(error));
}
})
.catch(error => Bluebird.reject(error instanceof KuzzleError ? error : new PluginImplementationError(error)));
});
};
});

Expand Down
2 changes: 1 addition & 1 deletion lib/api/dsl/transform/canonical.js
Expand Up @@ -227,7 +227,7 @@ class Canonical {
const
zero = evalFilter(filters, [0]),
one = evalFilter(filters, [1]),
combined = `${zero >>> 0}${one >>> 0}`; // string binary representation of the truth table output
combined = `${zero >>> 0}${one >>> 0}`; // string binary representation of the truth table output

if (combined === '00') {
return [];
Expand Down
2 changes: 1 addition & 1 deletion lib/services/internalEngine/pluginBootstrap.js
Expand Up @@ -46,7 +46,7 @@ class PluginInternalEngineBootstrap {
.then(() => Bluebird.resolve(this.kuzzle.indexCache.add(this.db.index)))
.catch(error => {
// plugin manager is initializing, cannot use the logger
console.error(error, error.stack); // eslint-disable-line no-console
console.error(error, error.stack); // eslint-disable-line no-console
throw error;
});
}
Expand Down
74 changes: 45 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -50,7 +50,7 @@
"node-units": "0.1.7",
"node-uuid": "1.4.8",
"passport": "0.3.2",
"pm2": "2.4.6",
"pm2": "^2.5.0",
"rc": "1.2.1",
"readline-sync": "^1.4.7",
"reify": "^0.11.24",
Expand All @@ -66,7 +66,7 @@
"devDependencies": {
"codecov": "2.2.0",
"cucumber": "^2.0.0-rc.9",
"eslint": "3.19.0",
"eslint": "^3.19.0",
"mocha": "3.4.2",
"mock-require": "^2.0.2",
"nyc": "^11.0.2",
Expand All @@ -76,7 +76,7 @@
"should": "11.2.1",
"should-sinon": "0.0.5",
"sinon": "^1.17.7",
"socket.io-client": "2.0.1"
"socket.io-client": "^2.0.3"
},
"engines": {
"node": ">= 6.9.1"
Expand Down
18 changes: 1 addition & 17 deletions test/api/core/pluginsManager/strategy.test.js
Expand Up @@ -175,22 +175,6 @@ describe('PluginsManager: strategy management', () => {
return should(authentications.someStrategy.methods.exists(foo)).be.rejectedWith(PluginImplementationError);
});

it('method invocation should intercept a rejected error to transform it into PluginImplementationError', () => {
plugin.existsFunction = sandbox.stub().returns(Promise.reject(new Error('some error')));

injectAuthentication(kuzzle, authentications, plugin, pluginName);
should(authentications.someStrategy.strategy).be.deepEqual(plugin.strategies.someStrategy);
should(authentications.someStrategy.methods.exists).be.Function();
should(authentications.someStrategy.methods.create).be.Function();
should(authentications.someStrategy.methods.update).be.Function();
should(authentications.someStrategy.methods.delete).be.Function();
should(authentications.someStrategy.methods.getInfo).be.Function();
should(authentications.someStrategy.methods.validate).be.Function();

return should(authentications.someStrategy.methods.exists(foo)).be.rejectedWith(PluginImplementationError);
});


it('should print an error in the console if strategies is not an object', () => {
plugin.strategies = {};

Expand Down Expand Up @@ -314,4 +298,4 @@ describe('PluginsManager: strategy management', () => {
}).throw(PluginImplementationError);
});
});
});
});
2 changes: 1 addition & 1 deletion test/mocks/services/redisClient.mock.js
Expand Up @@ -15,7 +15,7 @@ function RedisClientMock (err) {
var Stream = function () {
setTimeout(() => {
var
prefix = options && options.match ? options.match.replace(/[\*\?]/g, '') : 'k',
prefix = options && options.match ? options.match.replace(/[*?]/g, '') : 'k',
i,
keys = [];

Expand Down

0 comments on commit 07baed7

Please sign in to comment.