Skip to content

Commit 046b771

Browse files
committed
feat(update): update context
1 parent 14b7dcb commit 046b771

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

src/handler.ts

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
import { APIGatewayProxyEvent, APIGatewayProxyResult, Context } from 'aws-lambda';
1+
import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda';
22
import { ExampleService } from '../business/example-service';
33

4+
interface Context {
5+
clientContext: ClientContext
6+
};
7+
8+
interface ClientContext {
9+
gc_client_id: string
10+
gc_client_secret: string
11+
gc_aws_region: string
12+
};
13+
414
export const handler = async (
515
event: APIGatewayProxyEvent,
616
context: Context
@@ -57,18 +67,11 @@ if (require.main === module) {
5767
};
5868

5969
const fakeContext: Context = {
60-
callbackWaitsForEmptyEventLoop: false,
61-
functionName: 'test-function',
62-
functionVersion: '1',
63-
invokedFunctionArn: 'arn:aws:lambda:us-east-1:123456789012:function:test-function',
64-
memoryLimitInMB: '128',
65-
awsRequestId: 'test-request-id',
66-
logGroupName: '/aws/lambda/test-function',
67-
logStreamName: '2023/01/01/[$LATEST]test-stream',
68-
getRemainingTimeInMillis: () => 30000,
69-
done: () => {},
70-
fail: () => {},
71-
succeed: () => {}
70+
clientContext: {
71+
gc_client_id: 'asjkfhjdshdkjgf',
72+
gc_client_secret: 'dalksdljfsakj',
73+
gc_aws_region: 'us-east-1'
74+
}
7275
};
7376

7477
handler(fakeEvent, fakeContext)

0 commit comments

Comments
 (0)