1
1
'use strict' ;
2
2
3
3
const sinon = require ( 'sinon' ) ;
4
- const BbPromise = require ( 'bluebird' ) ;
5
4
6
5
const GoogleProvider = require ( '../../provider/googleProvider' ) ;
7
6
const GoogleDeploy = require ( '../googleDeploy' ) ;
@@ -39,8 +38,8 @@ describe('SetIamPolicy', () => {
39
38
let setPoliciesStub ;
40
39
41
40
beforeEach ( ( ) => {
42
- getFunctionsStub = sinon . stub ( googleDeploy , 'getFunctions' ) . returns ( BbPromise . resolve ( ) ) ;
43
- setPoliciesStub = sinon . stub ( googleDeploy , 'setPolicies' ) . returns ( BbPromise . resolve ( ) ) ;
41
+ getFunctionsStub = sinon . stub ( googleDeploy , 'getFunctions' ) . returns ( Promise . resolve ( ) ) ;
42
+ setPoliciesStub = sinon . stub ( googleDeploy , 'setPolicies' ) . returns ( Promise . resolve ( ) ) ;
44
43
} ) ;
45
44
46
45
afterEach ( ( ) => {
@@ -58,7 +57,7 @@ describe('SetIamPolicy', () => {
58
57
59
58
describe ( '#getFunctions' , ( ) => {
60
59
it ( 'should return "undefined" if no functions are found' , ( ) => {
61
- requestStub . returns ( BbPromise . resolve ( [ ] ) ) ;
60
+ requestStub . returns ( Promise . resolve ( [ ] ) ) ;
62
61
63
62
return googleDeploy . getFunctions ( ) . then ( ( foundFunctions ) => {
64
63
expect ( foundFunctions ) . toEqual ( undefined ) ;
@@ -81,7 +80,7 @@ describe('SetIamPolicy', () => {
81
80
const response = {
82
81
functions : [ { name : 'cloud-function-1' } , { name : 'cloud-function-2' } ] ,
83
82
} ;
84
- requestStub . returns ( BbPromise . resolve ( response ) ) ;
83
+ requestStub . returns ( Promise . resolve ( response ) ) ;
85
84
86
85
return googleDeploy . getFunctions ( ) . then ( ( foundFunctions ) => {
87
86
expect ( foundFunctions ) . toEqual ( [
@@ -160,7 +159,7 @@ describe('SetIamPolicy', () => {
160
159
googleDeploy . serverless . service . provider . functionIamBindings = {
161
160
'cloud-function-2' : [ { role : 'roles/cloudfunctions.invoker' , members : [ 'allUsers' ] } ] ,
162
161
} ;
163
- requestStub . returns ( BbPromise . resolve ( ) ) ;
162
+ requestStub . returns ( Promise . resolve ( ) ) ;
164
163
165
164
return googleDeploy . setPolicies ( foundFunctions ) . then ( ( ) => {
166
165
expect ( consoleLogStub . calledOnce ) . toEqual ( true ) ;
0 commit comments