Skip to content

Commit 6e32ecc

Browse files
committed
Add a test case for handing query params
1 parent a994700 commit 6e32ecc

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/integration.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,4 +274,29 @@ describe('integration', () => {
274274
});
275275
});
276276

277+
it('handles url GET params as expected', () => {
278+
const myEvent = {
279+
path: "/inspect",
280+
httpMethod: "GET",
281+
headers: {},
282+
multiValueHeaders: {},
283+
queryStringParameters: {
284+
paRaM1: 'valuE1',
285+
param2: 'value2'
286+
},
287+
isBase64Encoded: false,
288+
body: null
289+
}
290+
291+
return handler(myEvent).then(response => {
292+
expect(response.statusCode).toEqual(200);
293+
const json = JSON.parse(response.body);
294+
expect(json.originalUrl).toEqual("/inspect?paRaM1=valuE1&param2=value2");
295+
expect(json.query).toEqual({
296+
paRaM1: 'valuE1',
297+
param2: 'value2'
298+
})
299+
})
300+
});
301+
277302
})

0 commit comments

Comments
 (0)