Skip to content

Commit

Permalink
Skip known-bad test on old Node.js versions
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Aug 9, 2021
1 parent e083bc0 commit c24cbed
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/unpack.js
Expand Up @@ -2532,7 +2532,12 @@ t.test('trying to unpack a javascript file should fail', t => {
.once('error', er => t.match(er, expect, 'async emits'))
.on('error', () => { /* zlib emits a few times here */ })
.end(dataGzip)
t.throws(() => new UnpackSync(opts).end(dataGzip), expect, 'sync throws')
const skip = !/^v([0-9]|1[0-4])\./.test(process.version) ? false
: 'node prior to v14 did not raise sync zlib errors properly'
t.test('sync throws', { skip }, t => {
t.plan(1)
t.throws(() => new UnpackSync(opts).end(dataGzip), expect, 'sync throws')
})
})

t.test('bad archive if no gzip', t => {
Expand All @@ -2545,7 +2550,12 @@ t.test('trying to unpack a javascript file should fail', t => {
new Unpack(opts)
.on('error', er => t.match(er, expect, 'async emits'))
.end(data)
t.throws(() => new UnpackSync(opts).end(data), expect, 'sync throws')
const skip = !/^v([0-9]|1[0-4])\./.test(process.version) ? false
: 'node prior to v14 did not raise sync zlib errors properly'
t.test('sync throws', { skip }, t => {
t.plan(1)
t.throws(() => new UnpackSync(opts).end(data), expect, 'sync throws')
})
})

t.end()
Expand Down

0 comments on commit c24cbed

Please sign in to comment.