Skip to content

Commit 10fdc7a

Browse files
committed
test: modified case in e2e tests to use undefined
1 parent b2ccc5f commit 10fdc7a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/idempotency/tests/e2e/idempotentDecorator.test.FunctionCode.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ class DefaultLambda implements LambdaInterface {
2929
public async handler(
3030
_event: Record<string, unknown>,
3131
_context: Context
32-
): Promise<string> {
32+
): Promise<void> {
3333
logger.info(`Got test event: ${JSON.stringify(_event)}`);
3434
// sleep to enforce error with parallel execution
3535
await new Promise((resolve) => setTimeout(resolve, 1000));
3636

37-
return 'Hello World';
37+
// We return void to test that the utility handles it correctly
38+
return;
3839
}
3940

4041
@idempotent({

packages/idempotency/tests/e2e/idempotentDecorator.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ describe('Idempotency e2e test decorator, default settings', () => {
193193
expect(idempotencyRecord.Items?.[0].id).toEqual(
194194
`${functionNameDefault}#${payloadHash}`
195195
);
196-
expect(idempotencyRecord.Items?.[0].data).toEqual('Hello World');
196+
expect(idempotencyRecord.Items?.[0].data).toBeUndefined();
197197
expect(idempotencyRecord.Items?.[0].status).toEqual('COMPLETED');
198198
// During the first invocation the handler should be called, so the logs should contain 1 log
199199
expect(functionLogs[0]).toHaveLength(1);

0 commit comments

Comments
 (0)