mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
Fix the tests to use the updated log group reference
TODO: verify the loggroup resource addition
This commit is contained in:
parent
b8134cb15e
commit
596bb0eb98
@ -129,6 +129,7 @@ describe('AwsCompileFunctions', () => {
|
||||
});
|
||||
|
||||
it('should update IamPolicyLambdaExecution with a logging resource for the function', () => {
|
||||
const normalizedName = `${functionName[0].toUpperCase()}${functionName.substr(1)}LogGroup`;
|
||||
awsCompileFunctions.compileFunctions();
|
||||
|
||||
expect(awsCompileFunctions.serverless.service.provider.compiledCloudFormationTemplate
|
||||
@ -140,17 +141,7 @@ describe('AwsCompileFunctions', () => {
|
||||
.Resource
|
||||
).to.deep.equal(
|
||||
[
|
||||
{
|
||||
'Fn:Join': [
|
||||
':',
|
||||
[
|
||||
'arn:aws:logs',
|
||||
{ Ref: 'AWS::Region' },
|
||||
{ Ref: 'AWS::AccountId' },
|
||||
`log-group:/aws/lambda/${functionName}*:*:*`,
|
||||
],
|
||||
],
|
||||
},
|
||||
{ 'Fn:Join': [':', [{ 'Fn::GetAtt': [normalizedName, 'Arn'] }, '*', '*']] },
|
||||
]
|
||||
);
|
||||
});
|
||||
@ -167,6 +158,11 @@ describe('AwsCompileFunctions', () => {
|
||||
name: 'func1',
|
||||
},
|
||||
};
|
||||
const f = service.functions;
|
||||
const normalizedNames = [
|
||||
`${f.func0.name[0].toUpperCase()}${f.func0.name.substr(1)}LogGroup`,
|
||||
`${f.func1.name[0].toUpperCase()}${f.func1.name.substr(1)}LogGroup`,
|
||||
];
|
||||
awsCompileFunctions.compileFunctions();
|
||||
|
||||
expect(awsCompileFunctions.serverless.service.provider.compiledCloudFormationTemplate
|
||||
@ -178,28 +174,8 @@ describe('AwsCompileFunctions', () => {
|
||||
.Resource
|
||||
).to.deep.equal(
|
||||
[
|
||||
{
|
||||
'Fn:Join': [
|
||||
':',
|
||||
[
|
||||
'arn:aws:logs',
|
||||
{ Ref: 'AWS::Region' },
|
||||
{ Ref: 'AWS::AccountId' },
|
||||
`log-group:/aws/lambda/${service.functions.func0.name}*:*:*`,
|
||||
],
|
||||
],
|
||||
},
|
||||
{
|
||||
'Fn:Join': [
|
||||
':',
|
||||
[
|
||||
'arn:aws:logs',
|
||||
{ Ref: 'AWS::Region' },
|
||||
{ Ref: 'AWS::AccountId' },
|
||||
`log-group:/aws/lambda/${service.functions.func1.name}*:*:*`,
|
||||
],
|
||||
],
|
||||
},
|
||||
{ 'Fn:Join': [':', [{ 'Fn::GetAtt': [normalizedNames[0], 'Arn'] }, '*', '*']] },
|
||||
{ 'Fn:Join': [':', [{ 'Fn::GetAtt': [normalizedNames[1], 'Arn'] }, '*', '*']] },
|
||||
]
|
||||
);
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user