@@ -189,18 +189,13 @@ describe('OpenWhiskCompileHttpEvents', () => {
189
189
return expect ( result ) . to . deep . equal ( { basepath : '/my-service' , relpath : '/api/foo/bar' , operation : 'GET' , action : '/sample_ns/my-service_action-name' , responsetype : 'http' } ) ;
190
190
} ) ;
191
191
192
- /**
193
- it('should define http events with optional API GW parameters', () => {
192
+ it ( 'should define http events with explicit base path' , ( ) => {
194
193
openwhiskCompileHttpEvents . serverless . service . service = 'my-service'
195
194
openwhiskCompileHttpEvents . serverless . service . provider = { namespace : "sample_ns" } ;
196
- const http = {path: "/api/foo/bar", method: "GET", cors: true}
197
- let result = openwhiskCompileHttpEvents.compileHttpEvent('action-name', {}, http);
198
- expect(result.options).to.deep.equal({cors: true});
199
- http.cors = false
200
- result = openwhiskCompileHttpEvents.compileHttpEvent('action-name', {}, http);
201
- expect(result.options).to.deep.equal({cors: false});
195
+ const http = { path : "/api/foo/bar" , method : "GET" , resp : 'http' , basepath : '/custompath' }
196
+ const result = openwhiskCompileHttpEvents . compileHttpEvent ( 'action-name' , { } , http ) ;
197
+ return expect ( result ) . to . deep . equal ( { basepath : '/custompath' , relpath : '/api/foo/bar' , operation : 'GET' , action : '/sample_ns/my-service_action-name' , responsetype : 'http' } ) ;
202
198
} ) ;
203
- */
204
199
205
200
it ( 'should throw if http event value invalid' , ( ) => {
206
201
expect ( ( ) => openwhiskCompileHttpEvents . compileHttpEvent ( '' , { } , 'OPERATION' ) )
0 commit comments