From daefbeee8ff5f49e586860ef689c82ae0a8e5d9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barthelet?= Date: Tue, 15 Sep 2020 17:37:55 +0200 Subject: [PATCH] remove tests --- .../aws/package/compile/functions/index.js | 2 +- .../package/compile/functions/index.test.js | 46 ++----------------- 2 files changed, 5 insertions(+), 43 deletions(-) diff --git a/lib/plugins/aws/package/compile/functions/index.js b/lib/plugins/aws/package/compile/functions/index.js index da20c1d7d248..fd007a279dee 100644 --- a/lib/plugins/aws/package/compile/functions/index.js +++ b/lib/plugins/aws/package/compile/functions/index.js @@ -338,7 +338,7 @@ class AwsCompileFunctions { functionResource.Properties.FileSystemConfigs = [cfFileSystemConfig]; } - if (functionObject.reservedConcurrency) { + if (functionObject.reservedConcurrency || functionObject.reservedConcurrency === 0) { functionResource.Properties.ReservedConcurrentExecutions = functionObject.reservedConcurrency; } diff --git a/lib/plugins/aws/package/compile/functions/index.test.js b/lib/plugins/aws/package/compile/functions/index.test.js index e058bf92871d..becf00a634e8 100644 --- a/lib/plugins/aws/package/compile/functions/index.test.js +++ b/lib/plugins/aws/package/compile/functions/index.test.js @@ -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; @@ -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: { @@ -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' }); }); });