@@ -35,6 +35,40 @@ describe('#yamlParse', () => {
3535 serverlessStepFunctions . serverless . config . servicePath = 'servicePath' ;
3636 } ) ;
3737
38+ it ( 'should default to dev when stage and provider are not defined' , ( ) => {
39+ serverlessStepFunctions . serverless . pluginManager . cliOptions . stage = null ;
40+ serverlessStepFunctions . serverless . service . provider = null ;
41+ serverlessStepFunctions . yamlParse ( )
42+ . then ( ( ) => {
43+ expect ( serverless . pluginManager . cliOptions . stage ) . to . be . equal ( 'dev' ) ;
44+ } ) ;
45+ } ) ;
46+
47+ it ( 'should default to us-east-1 when region and provider are not defined' , ( ) => {
48+ serverlessStepFunctions . serverless . pluginManager . cliOptions . region = null ;
49+ serverlessStepFunctions . serverless . service . provider = null ;
50+ serverlessStepFunctions . yamlParse ( )
51+ . then ( ( ) => {
52+ expect ( serverless . pluginManager . cliOptions . region ) . to . be . equal ( 'us-east-1' ) ;
53+ } ) ;
54+ } ) ;
55+
56+ it ( 'should not default to dev when stage is defined' , ( ) => {
57+ serverlessStepFunctions . serverless . pluginManager . cliOptions . stage = 'my-stage' ;
58+ serverlessStepFunctions . yamlParse ( )
59+ . then ( ( ) => {
60+ expect ( serverless . pluginManager . cliOptions . stage ) . to . be . equal ( 'my-stage' ) ;
61+ } ) ;
62+ } ) ;
63+
64+ it ( 'should not default to us-east-1 when region is defined' , ( ) => {
65+ serverlessStepFunctions . serverless . pluginManager . cliOptions . region = 'my-region' ;
66+ serverlessStepFunctions . yamlParse ( )
67+ . then ( ( ) => {
68+ expect ( serverless . pluginManager . cliOptions . region ) . to . be . equal ( 'my-region' ) ;
69+ } ) ;
70+ } ) ;
71+
3872 it ( 'should throw error if servicePath is not given' , ( ) => {
3973 serverlessStepFunctions . serverless . config . servicePath = null ;
4074 serverlessStepFunctions . yamlParse ( )
0 commit comments