Skip to content

Commit 8d45e7e

Browse files
Moritz Petersmaritz
authored andcommitted
Change http2 test usage to describe.skip if no http2 available
1 parent eb2e280 commit 8d45e7e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/compression.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ var http = require('http')
77
var request = require('supertest')
88
var zlib = require('zlib')
99

10+
var describeHttp2 = describe.skip
1011
try {
1112
var http2 = require('http2')
13+
describeHttp2 = describe
1214
} catch (err) {
1315
if (err) {
1416
console.log('http2 tests disabled.')
@@ -309,7 +311,7 @@ describe('compression()', function () {
309311
.expect(200, done)
310312
})
311313

312-
if (http2) {
314+
describeHttp2('http2', function () {
313315
it('should work with http2 server', function (done) {
314316
var server = createHttp2Server({ threshold: 0 }, function (req, res) {
315317
res.setHeader('Content-Type', 'text/plain')
@@ -328,7 +330,7 @@ describe('compression()', function () {
328330
request.end()
329331
})
330332
})
331-
}
333+
})
332334

333335
describe('threshold', function () {
334336
it('should not compress responses below the threshold size', function (done) {

0 commit comments

Comments
 (0)