Skip to content

Commit

Permalink
fixed cdk handler unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Francis <colifran@amazon.com>
  • Loading branch information
colifran committed Nov 30, 2023
1 parent ffa888d commit fc02c0b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import { Stack } from '../../core';
import { CdkHandler } from '../lib/cdk-handler';

describe('cdk handler', () => {
let stack: Stack;
let codeDirectory: string;
beforeAll(() => {
stack = new Stack();
codeDirectory = path.join(__dirname, 'test-handler');
});

test('code directory property is correctly set', () => {
// GIVEN
const stack = new Stack();

// WHEN
const handler = new CdkHandler(stack, 'CdkHandler', {
codeDirectory,
Expand All @@ -23,6 +24,9 @@ describe('cdk handler', () => {
});

test('runtime property is correctly set', () => {
// GIVEN
const stack = new Stack();

// WHEN
const handler = new CdkHandler(stack, 'CdkHandler', {
codeDirectory,
Expand All @@ -34,6 +38,9 @@ describe('cdk handler', () => {
});

test('index.handler is default entrypoint', () => {
// GIVEN
const stack = new Stack();

// WHEN
const handler = new CdkHandler(stack, 'CdkHandler', {
codeDirectory,
Expand All @@ -45,6 +52,9 @@ describe('cdk handler', () => {
});

test('entrypoint property is set correctly for non-default entrypoint', () => {
// GIVEN
const stack = new Stack();

// WHEN
const handler = new CdkHandler(stack, 'CdkHandler', {
codeDirectory,
Expand Down

0 comments on commit fc02c0b

Please sign in to comment.