@@ -8,19 +8,20 @@ const StepFunctionsOfflinePlugin = require('../index');
88
99describe ( 'index.js' , ( ) => {
1010 global . hooks = {
11- beforeStart : 'before:step-functions-offline:start' ,
1211 start : 'step-functions-offline:start' ,
1312 isInstalledPluginSLSStepFunctions : 'step-functions-offline:isInstalledPluginSLSStepFunctions' ,
1413 findState : 'step-functions-offline:findState' ,
1514 findFunctionsPathAndHandler : 'step-functions-offline:findFunctionsPathAndHandler' ,
1615 loadEventFile : 'step-functions-offline:loadEventFile' ,
16+ loadEnvVariables : 'step-functions-offline:loadEnvVariables' ,
1717 buildStepWorkFlow : 'step-functions-offline:buildStepWorkFlow'
1818 } ;
1919
2020 const options = {
2121 stateMachine : 'foo' ,
2222 s : 'foo' ,
23- event : null
23+ event : null ,
24+ location : './tests'
2425 } ;
2526 const serverless = new Serverless ( ) ;
2627 serverless . cli = new CLI ( ) ;
@@ -49,14 +50,14 @@ describe('index.js', () => {
4950
5051 describe ( '#checkVariableInYML' , ( ) => {
5152 it ( 'should throw error - custom.stepFunctionsOffline does not exist' , ( ) => {
52- expect ( stepFunctionsOfflinePlugin . hooks [ hooks . beforeStart ] ) . to . throw ( / E N V _ V A R I A B L E S / ) ;
53+ expect ( stepFunctionsOfflinePlugin . hooks [ hooks . start ] ) . to . throw ( / E N V _ V A R I A B L E S / ) ;
5354 } ) ;
5455
5556 it ( 'should exists custom.stepFunctionsOffline' , ( ) => {
5657 stepFunctionsOfflinePlugin . serverless . service . custom = {
5758 stepFunctionsOffline : { FirstLambda : 'firstLamda/index.handler' }
5859 } ;
59- expect ( stepFunctionsOfflinePlugin . hooks [ hooks . beforeStart ] ) . to . not . throw ( ) ;
60+ expect ( stepFunctionsOfflinePlugin . hooks [ hooks . start ] ) . to . not . throw ( ) ;
6061 } ) ;
6162
6263 } ) ;
@@ -113,6 +114,15 @@ describe('index.js', () => {
113114 } ) ;
114115 } )
115116
117+
118+ describe ( '#loadEnvVariables' , ( ) => {
119+ it ( 'should return empty object' , ( ) => {
120+ const result = stepFunctionsOfflinePlugin . hooks [ hooks . loadEnvVariables ] ( ) ;
121+ expect ( result ) . to . be . undefined ;
122+ } ) ;
123+
124+ } ) ;
125+
116126 describe ( '#findState' , ( ) => {
117127 it ( 'should throw err - serverless.yml not exists' , ( ) => {
118128 // stepFunctionsOfflinePlugin.serverless.config = process.cwd() + '/serverless.test.yml';
0 commit comments