From ce1a44b023c97fc5516b76ffe26942bf4aa93d99 Mon Sep 17 00:00:00 2001 From: horike37 Date: Sun, 8 Jan 2017 21:24:03 +0900 Subject: [PATCH] linting happy --- index.js | 3 ++- index.test.js | 18 +++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/index.js b/index.js index 4b709cdb..7f21bf1f 100644 --- a/index.js +++ b/index.js @@ -111,7 +111,8 @@ class ServerlessStepFunctions { shortcut: 'd', }, path: { - usage: 'The path to a json file with input data to be passed to the invoked step function', + usage: + 'The path to a json file with input data to be passed to the invoked step function', shortcut: 'p', }, stage: { diff --git a/index.test.js b/index.test.js index fa33cf84..eb20e483 100644 --- a/index.test.js +++ b/index.test.js @@ -408,13 +408,10 @@ describe('ServerlessStepFunctions', () => { }); describe('#parseInputdate()', () => { - let fileExistsSyncStub; - let readFileSyncStub; beforeEach(() => { serverlessStepFunctions.serverless.config.servicePath = 'servicePath'; - fileExistsSyncStub = sinon.stub(serverlessStepFunctions.serverless.utils, 'fileExistsSync') - .returns(true); - readFileSyncStub = sinon.stub(serverlessStepFunctions.serverless.utils, 'readFileSync') + sinon.stub(serverlessStepFunctions.serverless.utils, 'fileExistsSync').returns(true); + sinon.stub(serverlessStepFunctions.serverless.utils, 'readFileSync') .returns({ foo: 'var' }); serverlessStepFunctions.options.data = null; serverlessStepFunctions.options.path = 'data.json'; @@ -422,19 +419,18 @@ describe('ServerlessStepFunctions', () => { it('should throw error if file does not exists', () => { serverlessStepFunctions.serverless.utils.fileExistsSync.restore(); - fileExistsSyncStub = sinon.stub(serverlessStepFunctions.serverless.utils, 'fileExistsSync') - .returns(false); + sinon.stub(serverlessStepFunctions.serverless.utils, 'fileExistsSync').returns(false); expect(() => serverlessStepFunctions.parseInputdate()).to.throw(Error); serverlessStepFunctions.serverless.utils.readFileSync.restore(); }); - it('should parse file if path param is provided', () => { - return serverlessStepFunctions.parseInputdate().then(() => { + it('should parse file if path param is provided' + , () => serverlessStepFunctions.parseInputdate().then(() => { expect(serverlessStepFunctions.options.data).to.deep.equal('{"foo":"var"}'); serverlessStepFunctions.serverless.utils.fileExistsSync.restore(); serverlessStepFunctions.serverless.utils.readFileSync.restore(); - }); - }); + }) + ); it('should return resolve if path param is not provided', () => { serverlessStepFunctions.options.path = null;