@@ -408,33 +408,29 @@ describe('ServerlessStepFunctions', () => {
408
408
} ) ;
409
409
410
410
describe ( '#parseInputdate()' , ( ) => {
411
- let fileExistsSyncStub ;
412
- let readFileSyncStub ;
413
411
beforeEach ( ( ) => {
414
412
serverlessStepFunctions . serverless . config . servicePath = 'servicePath' ;
415
- fileExistsSyncStub = sinon . stub ( serverlessStepFunctions . serverless . utils , 'fileExistsSync' )
416
- . returns ( true ) ;
417
- readFileSyncStub = sinon . stub ( serverlessStepFunctions . serverless . utils , 'readFileSync' )
413
+ sinon . stub ( serverlessStepFunctions . serverless . utils , 'fileExistsSync' ) . returns ( true ) ;
414
+ sinon . stub ( serverlessStepFunctions . serverless . utils , 'readFileSync' )
418
415
. returns ( { foo : 'var' } ) ;
419
416
serverlessStepFunctions . options . data = null ;
420
417
serverlessStepFunctions . options . path = 'data.json' ;
421
418
} ) ;
422
419
423
420
it ( 'should throw error if file does not exists' , ( ) => {
424
421
serverlessStepFunctions . serverless . utils . fileExistsSync . restore ( ) ;
425
- fileExistsSyncStub = sinon . stub ( serverlessStepFunctions . serverless . utils , 'fileExistsSync' )
426
- . returns ( false ) ;
422
+ sinon . stub ( serverlessStepFunctions . serverless . utils , 'fileExistsSync' ) . returns ( false ) ;
427
423
expect ( ( ) => serverlessStepFunctions . parseInputdate ( ) ) . to . throw ( Error ) ;
428
424
serverlessStepFunctions . serverless . utils . readFileSync . restore ( ) ;
429
425
} ) ;
430
426
431
- it ( 'should parse file if path param is provided' , ( ) => {
432
- return serverlessStepFunctions . parseInputdate ( ) . then ( ( ) => {
427
+ it ( 'should parse file if path param is provided'
428
+ , ( ) => serverlessStepFunctions . parseInputdate ( ) . then ( ( ) => {
433
429
expect ( serverlessStepFunctions . options . data ) . to . deep . equal ( '{"foo":"var"}' ) ;
434
430
serverlessStepFunctions . serverless . utils . fileExistsSync . restore ( ) ;
435
431
serverlessStepFunctions . serverless . utils . readFileSync . restore ( ) ;
436
- } ) ;
437
- } ) ;
432
+ } )
433
+ ) ;
438
434
439
435
it ( 'should return resolve if path param is not provided' , ( ) => {
440
436
serverlessStepFunctions . options . path = null ;
0 commit comments