forked from CodeGenieApp/serverless-express
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: refactor in prep for running tests in eventSource:framework matrix
- Loading branch information
1 parent
bcb594a
commit d4624c0
Showing
11 changed files
with
563 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const clone = require('./clone') | ||
const mergeDeep = require('./merge-deep') | ||
|
||
const albEvent = { | ||
'requestContext': { | ||
'elb': { | ||
'targetGroupArn': 'arn:aws:elasticloadbalancing:us-east-1:347971939225:targetgroup/aws-s-Targe-RJF5FKWHX6Y8/29425aed99131fd0' | ||
} | ||
}, | ||
'httpMethod': 'POST', | ||
'path': '/users', | ||
'multiValueQueryStringParameters': {}, | ||
'multiValueHeaders': { | ||
'accept': ['*/*'], | ||
'accept-encoding': ['gzip, deflate'], | ||
'accept-language': ['en-US,en;q=0.9'], | ||
'cache-control': ['no-cache'], | ||
'connection': ['keep-alive'], | ||
'content-length': ['26'], | ||
'content-type': ['application/json'], | ||
'host': ['aws-ser-alb-p9y7dvwm0r42-2135869912.us-east-1.elb.amazonaws.com'], | ||
'origin': ['http://aws-ser-alb-p9y7dvwm0r42-2135869912.us-east-1.elb.amazonaws.com'], | ||
'pragma': ['no-cache'], | ||
'referer': ['http://aws-ser-alb-p9y7dvwm0r42-2135869912.us-east-1.elb.amazonaws.com/'], | ||
'user-agent': ['Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36'], | ||
'x-amzn-trace-id': ['Root=1-5cdf3407-76d73870a87c746001f27090'], | ||
'x-forwarded-for': ['72.21.198.66'], | ||
'x-forwarded-port': ['80'], | ||
'x-forwarded-proto': ['http'] | ||
}, | ||
'body': '{"name":"postmaaaateeeee"}', | ||
'isBase64Encoded': false | ||
} | ||
|
||
module.exports = function makeAlbEvent (values = {}) { | ||
const baseEvent = clone(albEvent) | ||
const mergedEvent = mergeDeep(baseEvent, values) | ||
|
||
return mergedEvent | ||
} |
Oops, something went wrong.