Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
bjohansebas committed Jan 31, 2025
1 parent 132c1cc commit 0cbe659
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ var createHTTPServer = server.createHTTPServer
var createHTTP2Server = server.createHTTP2Server

var topDescribe = function (type, createServer) {
var options

if (type === 'http2') {
options = { http2: true }
}
var wrapper = function wrapper (req) {
if (type === 'http2') {
return req.http2()
Expand All @@ -24,7 +29,7 @@ var topDescribe = function (type, createServer) {

describe('onHeaders(res, listener)', function () {
it('should fire after setHeader', function (done) {
wrapper(request(createServer(echoListener)).get('/'))
request(createServer(echoListener), options).get('/')
.expect('X-Outgoing-Echo', 'test')
.expect(200, done)
})
Expand Down

0 comments on commit 0cbe659

Please sign in to comment.