Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
carlnordenfelt committed Dec 5, 2018
1 parent 4a2deec commit ab3835c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
1 change: 1 addition & 0 deletions example/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* istanbul ignore file */
const Lulo = require('lulo');

const lulo = Lulo({ logEvents: true, logResponse: true })
Expand Down
4 changes: 2 additions & 2 deletions src/lib/cfn-response.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied.
See the License for the specific language governing permissions and limitations under the License.
*/

/* istanbul ignore file */
const log = require('log4njs');
const https = require('https');
const url = require('url');
Expand Down Expand Up @@ -40,7 +40,7 @@ module.exports = (error, response, event, context, logResponse, callback) => {
RequestId: event.RequestId,
LogicalResourceId: event.LogicalResourceId,
Data: responseData,
NoEcho: event.ResourceProperties._NoEcho ? true : false
NoEcho: !!event.ResourceProperties._NoEcho
});

const parsedUrl = url.parse(event.ResponseURL);
Expand Down
21 changes: 10 additions & 11 deletions tests/unit/index-unit-test.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
'use strict';

const expect = require('chai').expect;
const expect = require('chai').expect;
const mockery = require('mockery');
const sinon = require('sinon');
const sinon = require('sinon');

describe('Index unit tests', () => {
let subject;
let event;
const responseStub = sinon.stub();
const validateStub = sinon.stub();
const createStub = sinon.stub();
const updateStub = sinon.stub();
const deleteStub = sinon.stub();
const logStub = sinon.stub();
const logEventStub = sinon.stub();
const responseStub = sinon.stub();
const validateStub = sinon.stub();
const createStub = sinon.stub();
const updateStub = sinon.stub();
const deleteStub = sinon.stub();
const logStub = sinon.stub();
const logEventStub = sinon.stub();
const normalizeStub = sinon.stub();

before(() => {
Expand Down Expand Up @@ -86,6 +84,7 @@ describe('Index unit tests', () => {
it('should fail on duplicate', (done) => {
expect(registerDuplicate).to.throw(/Trying to register same plugin name twice/);
done();

function registerDuplicate() {
subject()
.register('testPlugin', {})
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/lib/log-event-unit-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ describe('Logger unit tests', () => {

const logMock = {
info: infoStub,
options: function () { return logMock; }
options: function () {
return logMock;
}
};

mockery.registerMock('log4njs', logMock);
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/lib/normalize-unit-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ describe('Normalize unit tests', () => {

const logMock = {
warn: warnStub,
options: function () { return logMock; }
options: function () {
return logMock;
}
};
mockery.registerMock('log4njs', logMock);
subject = require('../../../src/lib/normalize');
Expand Down

0 comments on commit ab3835c

Please sign in to comment.