diff --git a/lib/plugins/aws/package/compile/functions/index.test.js b/lib/plugins/aws/package/compile/functions/index.test.js index becf00a634e8..e831f0600ac7 100644 --- a/lib/plugins/aws/package/compile/functions/index.test.js +++ b/lib/plugins/aws/package/compile/functions/index.test.js @@ -749,6 +749,11 @@ describe('AwsCompileFunctions', () => { let s3Folder; let s3FileName; + beforeEach(() => { + s3Folder = awsCompileFunctions.serverless.service.package.artifactDirectoryName; + s3FileName = awsCompileFunctions.serverless.service.package.artifact.split(path.sep).pop(); + }); + describe('when IamRoleLambdaExecution is used', () => { beforeEach(() => { // pretend that the IamRoleLambdaExecution is used @@ -2301,29 +2306,6 @@ describe('AwsCompileFunctions', () => { }); }); - describe('Errors if unsupported object type is provided', () => { - it('should throw for object type { Ref: "Foo" }', () => { - const role = { Ref: 'Foo' }; - const resource = { Properties: {} }; - - expect(() => awsCompileFunctions.compileRole(resource, role)).to.throw(Error); - }); - - it('should throw for object type Buffer', () => { - const role = Buffer.from('Foo'); - const resource = { Properties: {} }; - - expect(() => awsCompileFunctions.compileRole(resource, role)).to.throw(Error); - }); - - it('should throw for object type Array', () => { - const role = [1, 2, 3]; - const resource = { Properties: {} }; - - expect(() => awsCompileFunctions.compileRole(resource, role)).to.throw(Error); - }); - }); - it('should not set unset properties when not specified in yml (layers, vpc, etc)', () => { const s3Folder = awsCompileFunctions.serverless.service.package.artifactDirectoryName; const s3FileName = awsCompileFunctions.serverless.service.package.artifact