@@ -189,18 +189,13 @@ describe('OpenWhiskCompileHttpEvents', () => {
189189 return expect ( result ) . to . deep . equal ( { basepath : '/my-service' , relpath : '/api/foo/bar' , operation : 'GET' , action : '/sample_ns/my-service_action-name' , responsetype : 'http' } ) ;
190190 } ) ;
191191
192- /**
193- it('should define http events with optional API GW parameters', () => {
192+ it ( 'should define http events with explicit base path' , ( ) => {
194193 openwhiskCompileHttpEvents . serverless . service . service = 'my-service'
195194 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' } ) ;
202198 } ) ;
203- */
204199
205200 it ( 'should throw if http event value invalid' , ( ) => {
206201 expect ( ( ) => openwhiskCompileHttpEvents . compileHttpEvent ( '' , { } , 'OPERATION' ) )
0 commit comments