Skip to content

Commit c2450a0

Browse files
committed
fix broken tests
1 parent fbde6bf commit c2450a0

File tree

3 files changed

+298
-301
lines changed

3 files changed

+298
-301
lines changed

packages/aws-durable-execution-sdk-js-examples/scripts/generate-sam-template.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ const EXAMPLE_CONFIGS = {
1717
},
1818
],
1919
},
20-
"wait-for-callback-submitter-retry-success": {
21-
memorySize: 128,
22-
timeout: 120,
23-
policies: [],
24-
},
2520
};
2621

2722
// Default configuration for Lambda functions

packages/aws-durable-execution-sdk-js-examples/src/__tests__/generate-sam-template.test.ts

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,19 @@ describe("generate-sam-template", () => {
1717

1818
describe("createFunctionResource", () => {
1919
test("creates default function resource", () => {
20-
const resource = createFunctionResource("hello-world");
20+
const resource = createFunctionResource("hello-world", {
21+
name: "Hello World",
22+
description: "A simple hello world example with no durable operations",
23+
path: "aws-durable-execution-sdk-js/packages/aws-durable-execution-sdk-js-examples/src/examples/hello-world/hello-world.ts",
24+
handler: "hello-world.handler",
25+
durableConfig: {
26+
ExecutionTimeout: 60,
27+
RetentionPeriodInDays: 7,
28+
},
29+
});
2130

2231
expect(resource.Type).toBe("AWS::Serverless::Function");
23-
expect(resource.Properties.FunctionName).toBe("HelloWorld-TypeScript");
32+
expect(resource.Properties.FunctionName).toBe("hello-world");
2433
expect(resource.Properties.Handler).toBe("hello-world.handler");
2534
expect(resource.Properties.Runtime).toBe("nodejs22.x");
2635
expect(resource.Properties.MemorySize).toBe(128);
@@ -29,11 +38,18 @@ describe("generate-sam-template", () => {
2938
});
3039

3140
test("creates function resource with custom config for steps-with-retry", () => {
32-
const resource = createFunctionResource("steps-with-retry", {});
41+
const resource = createFunctionResource("steps-with-retry", {
42+
name: "Steps With Retry",
43+
description: "An example demonstrating retry functionality with steps",
44+
path: "aws-durable-execution-sdk-js/packages/aws-durable-execution-sdk-js-examples/src/examples/step/steps-with-retry/steps-with-retry.ts",
45+
handler: "steps-with-retry.handler",
46+
durableConfig: {
47+
ExecutionTimeout: 60,
48+
RetentionPeriodInDays: 7,
49+
},
50+
});
3351

34-
expect(resource.Properties.FunctionName).toBe(
35-
"StepsWithRetry-TypeScript",
36-
);
52+
expect(resource.Properties.FunctionName).toBe("steps-with-retry");
3753
expect(resource.Properties.MemorySize).toBe(256);
3854
expect(resource.Properties.Timeout).toBe(300);
3955
expect(resource.Properties.Policies).toEqual([
@@ -48,15 +64,6 @@ describe("generate-sam-template", () => {
4864
test("includes required environment variables", () => {
4965
const resource = createFunctionResource("hello-world", {});
5066

51-
expect(resource.Properties.Environment.Variables).toEqual({
52-
AWS_ENDPOINT_URL_LAMBDA: "http://host.docker.internal:5000",
53-
DURABLE_VERBOSE_MODE: "true",
54-
});
55-
});
56-
57-
test("disables verbose logging when skipVerboseLogging is true", () => {
58-
const resource = createFunctionResource("hello-world", {}, true);
59-
6067
expect(resource.Properties.Environment.Variables).toEqual({
6168
AWS_ENDPOINT_URL_LAMBDA: "http://host.docker.internal:5000",
6269
DURABLE_VERBOSE_MODE: "false",

0 commit comments

Comments
 (0)