Skip to content

Commit 6e4ad20

Browse files
committed
refactor: remove old maker functions for api gateway objects
1 parent 5005a8c commit 6e4ad20

File tree

1 file changed

+0
-95
lines changed

1 file changed

+0
-95
lines changed

tests/samples.ts

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -67,103 +67,8 @@ export const handlerContext = (fillAllFields: boolean = false): Context => {
6767
return ctx;
6868
};
6969

70-
export const apiGatewayRequestContext = (): APIGatewayEventRequestContext => {
71-
return {
72-
accountId: '123456789012',
73-
apiId: 'someapi',
74-
authorizer: null,
75-
httpMethod: 'GET',
76-
identity: {
77-
accessKey: null,
78-
accountId: null,
79-
apiKey: null,
80-
apiKeyId: null,
81-
caller: null,
82-
clientCert: null,
83-
cognitoAuthenticationProvider: null,
84-
cognitoAuthenticationType: null,
85-
cognitoIdentityId: null,
86-
cognitoIdentityPoolId: null,
87-
principalOrgId: null,
88-
sourceIp: '12.12.12.12',
89-
user: null,
90-
userAgent: 'curl/7.54.0',
91-
userArn: null,
92-
},
93-
path: '/prd',
94-
protocol: 'HTTP/1.1',
95-
stage: 'prd',
96-
requestId: 'a507736b-259e-11e9-8fcf-4f1f08c4591e',
97-
requestTimeEpoch: 1548969891530,
98-
resourceId: 'reas23acc',
99-
resourcePath: '/',
100-
};
101-
};
102-
10370
export const apiGatewayRequestRawQuery = '?&foo[a]=bar%20b&foo[a]=baz%20c&x=1&x=2&y=z';
10471

105-
export const apiGatewayRequest = (): APIGatewayRequestEvent => {
106-
return {
107-
body: null,
108-
httpMethod: 'GET',
109-
isBase64Encoded: false,
110-
path: '/echo/asdf/a',
111-
resource: '/{proxy+}',
112-
pathParameters: { proxy: 'echo/asdf/a' },
113-
stageVariables: null,
114-
requestContext: apiGatewayRequestContext(),
115-
headers: {
116-
Accept: '*/*',
117-
'CloudFront-Forwarded-Proto': 'https',
118-
'CloudFront-Is-Desktop-Viewer': 'true',
119-
'CloudFront-Is-Mobile-Viewer': 'false',
120-
'CloudFront-Is-SmartTV-Viewer': 'false',
121-
'CloudFront-Is-Tablet-Viewer': 'false',
122-
'CloudFront-Viewer-Country': 'US',
123-
Host: 'b5gee6dacf.execute-api.us-east-1.amazonaws.com',
124-
'User-Agent': 'curl/7.54.0',
125-
Via: '2.0 4ee511e558a0400aa4b9c1d34d92af5a.cloudfront.net (CloudFront)',
126-
'X-Amz-Cf-Id': 'xn-ohXlUAed-32bae2cfb7164fd690ffffb87d36b032==',
127-
'X-Amzn-Trace-Id': 'Root=1-4b5398e2-a7fbe4f92f2e911013cba76b',
128-
'X-Forwarded-For': '8.8.8.8, 2.3.4.5',
129-
'X-Forwarded-Port': '443',
130-
'X-Forwarded-Proto': 'https',
131-
Referer: 'https://en.wikipedia.org/wiki/HTTP_referer',
132-
Cookie: 'uid=abc; ga=1234; foo=bar; baz=foo%5Ba%5D; obj=j%3A%7B%22abc%22%3A123%7D; onechar=j; bad=j%3A%7Ba%7D',
133-
},
134-
multiValueHeaders: {
135-
Accept: [ '*/*' ],
136-
Foo: [ 'bar', 'baz' ],
137-
'CloudFront-Forwarded-Proto': [ 'https' ],
138-
'CloudFront-Is-Desktop-Viewer': [ 'true' ],
139-
'CloudFront-Is-Mobile-Viewer': [ 'false' ],
140-
'CloudFront-Is-SmartTV-Viewer': [ 'false' ],
141-
'CloudFront-Is-Tablet-Viewer': [ 'false' ],
142-
'CloudFront-Viewer-Country': [ 'US' ],
143-
Host: [ 'b5gee6dacf.execute-api.us-east-1.amazonaws.com' ],
144-
'User-Agent': [ 'curl/7.54.0' ],
145-
Via: [ '2.0 4ee511e558a0400aa4b9c1d34d92af5a.cloudfront.net (CloudFront)' ],
146-
'X-Amz-Cf-Id': [ 'xn-ohXlUAed-32bae2cfb7164fd690ffffb87d36b032==' ],
147-
'X-Amzn-Trace-Id': [ 'Root=1-4b5398e2-a7fbe4f92f2e911013cba76b' ],
148-
'X-Forwarded-For': [ '8.8.8.8, 2.3.4.5' ],
149-
'X-Forwarded-Port': [ '443' ],
150-
'X-Forwarded-Proto': [ 'https' ],
151-
Referer: [ 'https://en.wikipedia.org/wiki/HTTP_referer' ],
152-
Cookie: [ 'uid=abc; ga=1234; foo=bar; baz=foo%5Ba%5D; obj=j%3A%7B%22abc%22%3A123%7D; onechar=j; bad=j%3A%7Ba%7D' ],
153-
},
154-
queryStringParameters: {
155-
'foo[a]': 'bar b',
156-
x: '2',
157-
y: 'z',
158-
},
159-
multiValueQueryStringParameters: {
160-
'foo[a]': [ 'bar b', 'baz c' ],
161-
x: [ '1', '2' ],
162-
y: [ 'z' ],
163-
},
164-
};
165-
};
166-
16772
export const albRequestContext = (): ApplicationLoadBalancerEventRequestContext => {
16873
return {
16974
elb: {

0 commit comments

Comments
 (0)