@@ -33,16 +33,16 @@ const serverless = require('./lib/serverless')({ service: { functions: { 'my-fun
33
33
34
34
require ( 'chai' ) . use ( chaiAsPromised ) ;
35
35
36
- function nocksvc ( url , funcs ) {
36
+ function nocksvc ( url , funcs , namespace = 'default' ) {
37
37
nock ( url )
38
- . get ( ' /api/v1/namespaces/default /services' )
38
+ . get ( ` /api/v1/namespaces/${ namespace } /services` )
39
39
. reply ( 200 , {
40
40
items : _ . map ( _ . flatten ( [ funcs ] ) , f => ( {
41
41
metadata :
42
42
{
43
43
name : f ,
44
44
namespace : 'default' ,
45
- selfLink : `/api/v1/namespaces/default /services/${ f } ` ,
45
+ selfLink : `/api/v1/namespaces/${ namespace } /services/${ f } ` ,
46
46
uid : '010a169d-618c-11e7-9939-080027abf356' ,
47
47
resourceVersion : '248' ,
48
48
creationTimestamp : '2017-07-05T14:12:39Z' ,
@@ -234,7 +234,7 @@ describe('KubelessInvoke', () => {
234
234
statusMessage : 'OK' ,
235
235
} ) ;
236
236
} ) ;
237
- nocksvc ( kubeApiURL , func ) ;
237
+ nocksvc ( kubeApiURL , func , serverlessWithNS . service . provider . namespace ) ;
238
238
return kubelessInvoke . invokeFunction ( ) . then ( ( res ) => {
239
239
expect ( res ) . to . be . eql ( {
240
240
statusCode : 200 ,
@@ -257,7 +257,7 @@ describe('KubelessInvoke', () => {
257
257
statusMessage : 'OK' ,
258
258
} ) ;
259
259
} ) ;
260
- nocksvc ( kubeApiURL , func ) ;
260
+ nocksvc ( kubeApiURL , func , serverlessWithNS . service . functions [ func ] . namespace ) ;
261
261
return kubelessInvoke . invokeFunction ( ) . then ( ( res ) => {
262
262
expect ( res ) . to . be . eql ( {
263
263
statusCode : 200 ,
0 commit comments