File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ module.exports = {
88 this . options . stage = _ . get ( this , 'options.stage' )
99 || 'dev' ;
1010 this . options . region = _ . get ( this , 'options.region' )
11+ || _ . get ( this , 'serverless.service.provider.region' )
1112 || 'us-central1' ;
1213
1314 return BbPromise . resolve ( ) ;
Original file line number Diff line number Diff line change @@ -31,5 +31,17 @@ describe('Utils', () => {
3131 expect ( googleCommand . options . region ) . toEqual ( 'my-region' ) ;
3232 } ) ;
3333 } ) ;
34+
35+
36+ it ( 'should set the provider values for stage and region if provided' , ( ) => {
37+ googleCommand . serverless . service . provider = {
38+ region : 'my-region' ,
39+ } ;
40+
41+ return googleCommand . setDefaults ( ) . then ( ( ) => {
42+ expect ( googleCommand . options . region ) . toEqual ( 'my-region' ) ;
43+ } ) ;
44+ } ) ;
45+
3446 } ) ;
3547} ) ;
You can’t perform that action at this time.
0 commit comments