Skip to content

Commit

Permalink
remove tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericbarthelet committed Sep 15, 2020
1 parent a2343bc commit daefbee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 43 deletions.
2 changes: 1 addition & 1 deletion lib/plugins/aws/package/compile/functions/index.js
Expand Up @@ -338,7 +338,7 @@ class AwsCompileFunctions {
functionResource.Properties.FileSystemConfigs = [cfFileSystemConfig];
}

if (functionObject.reservedConcurrency) {
if (functionObject.reservedConcurrency || functionObject.reservedConcurrency === 0) {
functionResource.Properties.ReservedConcurrentExecutions =
functionObject.reservedConcurrency;
}
Expand Down
46 changes: 4 additions & 42 deletions lib/plugins/aws/package/compile/functions/index.test.js
Expand Up @@ -75,21 +75,6 @@ describe('AwsCompileFunctions', () => {
expect(awsCompileFunctions.provider).to.be.instanceof(AwsProvider));
});

describe('#isArnRefGetAttOrImportValue()', () => {
it('should accept a Ref', () =>
expect(awsCompileFunctions.isArnRefGetAttOrImportValue({ Ref: 'DLQ' })).to.equal(true));
it('should accept a Fn::GetAtt', () =>
expect(
awsCompileFunctions.isArnRefGetAttOrImportValue({ 'Fn::GetAtt': ['DLQ', 'Arn'] })
).to.equal(true));
it('should accept a Fn::ImportValue', () =>
expect(
awsCompileFunctions.isArnRefGetAttOrImportValue({ 'Fn::ImportValue': 'DLQ' })
).to.equal(true));
it('should reject other objects', () =>
expect(awsCompileFunctions.isArnRefGetAttOrImportValue({ Blah: 'vtha' })).to.equal(false));
});

describe('#downloadPackageArtifacts()', () => {
let requestStub;
let testFilePath;
Expand Down Expand Up @@ -1747,21 +1732,6 @@ describe('AwsCompileFunctions', () => {
});
});

it('should throw an error if environment variable has invalid name', () => {
awsCompileFunctions.serverless.service.functions = {
func: {
handler: 'func.function.handler',
name: 'new-service-dev-func',
environment: {
'1test1': 'test1',
'test2': 'test2',
},
},
};

return expect(awsCompileFunctions.compileFunctions()).to.be.rejectedWith(Error);
});

it('should accept an environment variable with a not-string value', () => {
awsCompileFunctions.serverless.service.functions = {
func: {
Expand Down Expand Up @@ -1798,18 +1768,10 @@ describe('AwsCompileFunctions', () => {
};

return expect(awsCompileFunctions.compileFunctions()).to.be.fulfilled.then(() => {
awsCompileFunctions.serverless.service.functions = {
func: {
handler: 'func.function.handler',
name: 'new-service-dev-func',
environment: {
counter: {
NotRef: 'TestVariable',
},
},
},
};
return expect(awsCompileFunctions.compileFunctions()).to.be.rejectedWith(Error);
expect(
awsCompileFunctions.serverless.service.provider.compiledCloudFormationTemplate.Resources
.FuncLambdaFunction.Properties.Environment.Variables.counter
).to.eql({ Ref: 'TestVariable' });
});
});

Expand Down

0 comments on commit daefbee

Please sign in to comment.