From 90acf61dcf01ccd9ff547b3aa240282be505e4e9 Mon Sep 17 00:00:00 2001 From: wu-bacca Date: Wed, 20 Mar 2024 21:15:29 +0100 Subject: [PATCH] Add simple infra tests. --- infra/test/infra.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/infra/test/infra.test.ts b/infra/test/infra.test.ts index 7aaa8f2..18a7be3 100644 --- a/infra/test/infra.test.ts +++ b/infra/test/infra.test.ts @@ -2,10 +2,10 @@ import * as cdk from 'aws-cdk-lib'; import { Template, Match } from 'aws-cdk-lib/assertions'; import * as Infra from '../lib/infra-stack'; -test('SQS Queue and SNS Topic Created', () => { +test("Lambda and API Gateway Created", () => { const app = new cdk.App(); // WHEN - const stack = new Infra.InfraStack(app, 'MyTestStack', { + const stack = new Infra.InfraStack(app, "MyTestStack", { fullName: "test-test", pascalCaseFullName: "TestTest", applicationTag: "app-tag-test", @@ -15,8 +15,8 @@ test('SQS Queue and SNS Topic Created', () => { const template = Template.fromStack(stack); - // template.hasResourceProperties('AWS::SQS::Queue', { - // VisibilityTimeout: 300 - // }); - // template.resourceCountIs('AWS::SNS::Topic', 1); + template.hasResourceProperties("AWS::Lambda::Function", { + FunctionName: "test-test-function" + }); + template.resourceCountIs("AWS::ApiGateway::Method", 1); });