From 86a573ba06b903049a7b55c4e1c651c33810c4d4 Mon Sep 17 00:00:00 2001 From: Zoe Zhang Date: Sat, 19 Sep 2020 15:00:05 +1200 Subject: [PATCH] run prettify for new changes --- .../aws/package/compile/events/sns/index.js | 8 +++++--- .../package/compile/events/sns/index.test.js | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/lib/plugins/aws/package/compile/events/sns/index.js b/lib/plugins/aws/package/compile/events/sns/index.js index ac2f0318800f..9b41dcf3bd8a 100644 --- a/lib/plugins/aws/package/compile/events/sns/index.js +++ b/lib/plugins/aws/package/compile/events/sns/index.js @@ -118,9 +118,11 @@ class AwsCompileSNSEvents { targetUrl = { 'Fn::Join': [ '', - `https://sqs.${deRegion}.`, - { Ref: 'AWS::URLSuffix' }, - `/${deAccount}/${deQueueName}`, + [ + `https://sqs.${deRegion}.`, + { Ref: 'AWS::URLSuffix' }, + `/${deAccount}/${deQueueName}`, + ], ], }; } else if (deadLetterTargetRef) { diff --git a/lib/plugins/aws/package/compile/events/sns/index.test.js b/lib/plugins/aws/package/compile/events/sns/index.test.js index 4e74f0aa514d..286bd0b0eeab 100644 --- a/lib/plugins/aws/package/compile/events/sns/index.test.js +++ b/lib/plugins/aws/package/compile/events/sns/index.test.js @@ -591,6 +591,23 @@ describe('AwsCompileSNSEvents', () => { awsCompileSNSEvents.serverless.service.provider.compiledCloudFormationTemplate.Resources .Topic1ToFirstDLQPolicy.Type ).to.equal('AWS::SQS::QueuePolicy'); + expect( + awsCompileSNSEvents.serverless.service.provider.compiledCloudFormationTemplate.Resources + .Topic1ToFirstDLQPolicy.Properties.Queues + ).to.deep.equal([ + { + 'Fn::Join': [ + '', + [ + 'https://sqs.us-east-1.', + { + Ref: 'AWS::URLSuffix', + }, + '/11111111111/myDLQ', + ], + ], + }, + ]); }); it('should link topic to corresponding dlq when redrivePolicy is defined with resource ref', () => {