mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
Merge pull request #1364 from serverless/fix-lambda-uri-in-methods-compilation
Fix lambdaUri in methods compilation
This commit is contained in:
commit
fd8fa024e3
@ -20,7 +20,7 @@ module.exports = {
|
||||
const lambdaUri = `arn:aws:apigateway:${
|
||||
this.options.region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${
|
||||
this.options.region}:${awsAccountNumber}:function:${
|
||||
serviceName}-${functionName}/invocations`;
|
||||
serviceName}-${this.options.stage}-${functionName}/invocations`;
|
||||
|
||||
// universal velocity template
|
||||
// provides `{body, method, headers, query, path, identity, stageVariables} = event`
|
||||
|
||||
@ -65,4 +65,23 @@ describe('#compileMethods()', () => {
|
||||
).to.equal('AWS::ApiGateway::Method');
|
||||
})
|
||||
);
|
||||
|
||||
it('should set the correct lambdaUri', () => {
|
||||
const lambdaUri = `arn:aws:apigateway:${
|
||||
awsCompileApigEvents.options.region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${
|
||||
awsCompileApigEvents.options.region}:12345678:function:${
|
||||
awsCompileApigEvents.serverless.service.service}-${
|
||||
awsCompileApigEvents.options.stage}-first/invocations`;
|
||||
|
||||
return awsCompileApigEvents.compileMethods().then(() => {
|
||||
expect(
|
||||
awsCompileApigEvents.serverless.service.resources.Resources.PostMethodApigEvent0.Properties
|
||||
.Integration.Uri
|
||||
).to.equal(lambdaUri);
|
||||
expect(
|
||||
awsCompileApigEvents.serverless.service.resources.Resources.GetMethodApigEvent1.Properties
|
||||
.Integration.Uri
|
||||
).to.equal(lambdaUri);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user