Skip to content

Commit 6797752

Browse files
committed
tests: add test for util.inspect in HTML response
1 parent b6e53d7 commit 6797752

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/test.js

+11
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,17 @@ describe('errorHandler()', function () {
129129
.expect(/<li> &nbsp; &nbsp;at/)
130130
.expect(500, done)
131131
})
132+
133+
it('should contain inspected object', function (done) {
134+
request(createServer({ foo: 'bar', fizz: 'buzz' }))
135+
.get('/')
136+
.set('Accept', 'text/html')
137+
.expect('Content-Type', /text\/html/)
138+
.expect(/<title>Error<\/title>/)
139+
.expect(/<h2><em>500<\/em> Error<\/h2>/)
140+
.expect(/<li>{ foo: &#39;bar&#39;, fizz: &#39;buzz&#39; }<\/li>/)
141+
.expect(500, done)
142+
})
132143
})
133144

134145
describe('when "Accept: application/json"', function () {

0 commit comments

Comments
 (0)