Skip to content

Commit

Permalink
skip brotli tests on node 8
Browse files Browse the repository at this point in the history
Should not have been removed in a308619.
  • Loading branch information
isaacs committed Oct 1, 2019
1 parent 51e62f2 commit 1512437
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
4 changes: 4 additions & 0 deletions test/brotli-flush.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
'use strict';
const t = require('tap')
if (!require('zlib').BrotliDecompress) {
t.plan(0, 'brotli not supported')
process.exit(0)
}
const zlib = require('../')
const {resolve} = require('path')
const fixture = resolve(__dirname, 'fixtures/person.jpg')
Expand Down
4 changes: 4 additions & 0 deletions test/brotli-from-brotli.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// piped in as fast as possible.

const t = require('tap')
if (!require('zlib').BrotliDecompress) {
t.plan(0, 'brotli not supported')
process.exit(0)
}
const zlib = require('../')
const {resolve, basename} = require('path')
const {sync: mkdirp} = require('mkdirp')
Expand Down
4 changes: 4 additions & 0 deletions test/brotli-from-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
// Test compressing and uncompressing a string with brotli

const t = require('tap')
if (!require('zlib').BrotliDecompress) {
t.plan(0, 'brotli not supported')
process.exit(0)
}
const zlib = require('../');

const inputString = 'ΩΩLorem ipsum dolor sit amet, consectetur adipiscing eli' +
Expand Down
6 changes: 5 additions & 1 deletion test/brotli-kmaxlength-rangeerror.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
// https://github.com/nodejs/node/pull/1811

const t = require('tap')

// Change kMaxLength for zlib to trigger the error without having to allocate
// large Buffers.
const buffer = require('buffer');
const oldkMaxLength = buffer.kMaxLength;
buffer.kMaxLength = 128;
if (!require('zlib').BrotliDecompress) {
t.plan(0, 'brotli not supported')
process.exit(0)
}

const zlib = require('../');
buffer.kMaxLength = oldkMaxLength;

Expand Down
4 changes: 4 additions & 0 deletions test/brotli.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
const t = require('tap')
if (!require('zlib').BrotliDecompress) {
t.plan(0, 'brotli not supported')
process.exit(0)
}
const zlib = require('../')
const fs = require('fs')
const {resolve} = require('path')
Expand Down

0 comments on commit 1512437

Please sign in to comment.