From cebb79664038abe52776202c9ea23ce9a3c854a8 Mon Sep 17 00:00:00 2001 From: overbit <2861984+overbit@users.noreply.github.com> Date: Thu, 27 Oct 2022 20:48:10 +0100 Subject: [PATCH] fix: unit test for StartingPositionTimestamp --- .../aws/package/compile/events/kafka.test.js | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/test/unit/lib/plugins/aws/package/compile/events/kafka.test.js b/test/unit/lib/plugins/aws/package/compile/events/kafka.test.js index 077d666de9c..e0ca076defc 100644 --- a/test/unit/lib/plugins/aws/package/compile/events/kafka.test.js +++ b/test/unit/lib/plugins/aws/package/compile/events/kafka.test.js @@ -536,7 +536,7 @@ describe('test/unit/lib/plugins/aws/package/compile/events/kafka.test.js', () => describe('startingPositionTimestamp', () => { it('should fail to compile EventSourceMapping resource properties for startingPosition AT_TIMESTAMP with no startingPositionTimestamp', async () => { await expect( - await runServerless({ + runServerless({ fixture: 'function', configExt: { functions: { @@ -561,35 +561,35 @@ describe('test/unit/lib/plugins/aws/package/compile/events/kafka.test.js', () => code: 'FUNCTION_KAFKA_STARTING_POSITION_TIMESTAMP_INVALID', }); }); - }); - it('should correctly compile EventSourceMapping resource properties for startingPosition', async () => { - const { awsNaming, cfTemplate } = await runServerless({ - fixture: 'function', - configExt: { - functions: { - basic: { - role: { 'Fn::ImportValue': 'MyImportedRole' }, - events: [ - { - kafka: { - topic, - bootstrapServers: ['abc.xyz:9092'], - accessConfigurations: { saslScram256Auth: saslScram256AuthArn }, - startingPosition: 'AT_TIMESTAMP', - startingPositionTimestamp: 123, + it('should correctly compile EventSourceMapping resource properties for startingPosition', async () => { + const { awsNaming, cfTemplate } = await runServerless({ + fixture: 'function', + configExt: { + functions: { + basic: { + role: { 'Fn::ImportValue': 'MyImportedRole' }, + events: [ + { + kafka: { + topic, + bootstrapServers: ['abc.xyz:9092'], + accessConfigurations: { saslScram256Auth: saslScram256AuthArn }, + startingPosition: 'AT_TIMESTAMP', + startingPositionTimestamp: 123, + }, }, - }, - ], + ], + }, }, }, - }, - command: 'package', - }); + command: 'package', + }); - const eventSourceMappingResource = - cfTemplate.Resources[awsNaming.getKafkaEventLogicalId('basic', 'TestingTopic')]; - expect(eventSourceMappingResource.Properties.StartingPositionTimestamp).to.deep.equal(123); + const eventSourceMappingResource = + cfTemplate.Resources[awsNaming.getKafkaEventLogicalId('basic', 'TestingTopic')]; + expect(eventSourceMappingResource.Properties.StartingPositionTimestamp).to.deep.equal(123); + }); }); it('should not add dependsOn for imported role', async () => {