8000 add tests for statusDescriptions · jthomerson/lambda-api@20303b2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 20303b2

Browse files
committed
add tests for statusDescriptions
1 parent 776dde2 commit 20303b2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/requests.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ describe('Request Tests:', function() {
9797
// console.log(JSON.stringify(result,null,2));
9898
expect(result.headers).to.deep.equal({ 'content-type': 'application/json', 'set-cookie': 'test2=value2; Path=/' })
9999
expect(body).to.have.property('request')
100+
expect(result.statusDescription).to.equal('200 OK')
100101
expect(body.request.id).is.not.null
101102
expect(body.request.interface).to.equal('alb')
102103
expect(body.request.userAgent).to.equal('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36 OPR/39.0.2256.48')
@@ -119,6 +120,7 @@ describe('Request Tests:', function() {
119120
// console.log(JSON.stringify(result,null,2));
120121
expect(result.multiValueHeaders).to.deep.equal({ 'content-type': ['application/json'], 'set-cookie': ['test=value; Path=/','test2=value2; Path=/'] })
121122
expect(body).to.have.property('request')
123+
expect(result.statusDescription).to.equal('200 OK')
122124
expect(body.request.id).is.not.null
123125
expect(body.request.interface).to.equal('alb')
124126
expect(body.request.userAgent).to.equal('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36 OPR/39.0.2256.48')
@@ -137,7 +139,7 @@ describe('Request Tests:', function() {
137139
})
138140

139141

140-
it('Alternate statuss code', async function() {
142+
it('Alternate status code', async function() {
141143
let _event = Object.assign(require('./sample-event-alb2.json'),{ path: '/test/201' })
142144
let _context = require('./sample-context-alb1.json')
143145
let result = await new Promise(r => api.run(_event,_context,(e,res) => { r(res) }))

0 commit comments

Comments
 (0)
0