Skip to content

Commit b8d54ab

Browse files
CCM-10591: Lambda Boilerplate
1 parent 6275eab commit b8d54ab

File tree

5 files changed

+7756
-19
lines changed

5 files changed

+7756
-19
lines changed

lambdas/example-lambda/src/__tests__/index.test.ts

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,12 @@
11
import { handler } from '../index';
22

33
describe('event-logging Lambda', () => {
4-
let logSpy: jest.SpyInstance;
5-
6-
beforeAll(() => {
7-
logSpy = jest.spyOn(console, 'log').mockImplementation(() => {});
8-
});
9-
10-
afterEach(() => {
11-
logSpy.mockClear();
12-
});
13-
14-
afterAll(() => {
15-
logSpy.mockRestore();
16-
});
17-
184
it('logs the input event and returns 200', async () => {
195
const event = { foo: 'bar' };
20-
const result = await handler(event, {} as any, () => undefined);
6+
const context = {} as any;
7+
const callback = jest.fn();
8+
const result = await handler(event, context, callback);
219

22-
expect(logSpy).toHaveBeenCalledWith('Received event:', event);
2310
expect(result).toEqual({
2411
statusCode: 200,
2512
body: 'Event logged',

lambdas/example-lambda/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "@tsconfig/node20/tsconfig.json",
2+
"extends": "@tsconfig/node22/tsconfig.json",
33
"include": [
44
"src/**/*"
55
]

0 commit comments

Comments
 (0)