From 4cd8d80b23dd1eb0bcfb65187fc651c307d40fa0 Mon Sep 17 00:00:00 2001 From: Pelle Wessman Date: Mon, 27 Nov 2023 16:12:07 +0100 Subject: [PATCH 1/2] Fix test failing on new node versions --- test/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/index.js b/test/index.js index 4ff9852..382e768 100755 --- a/test/index.js +++ b/test/index.js @@ -2111,7 +2111,7 @@ describe('gunzip', () => { const options = { json: true }; const err = await expect(Wreck.get(`http://localhost:${server.address().port}`, options)).to.reject(); - expect(err).to.be.an.error('Unexpected token \u001f in JSON at position 0'); + expect(err).to.be.an.error(/Unexpected token/); expect(err.data.res.statusCode).to.equal(200); expect(err.data.payload).to.equal(Zlib.gzipSync(JSON.stringify({ foo: 'bar' }))); flags.onCleanup = () => server.close(); From 1fda1c3009523509c03165bb3fa30bb5ba19f4c3 Mon Sep 17 00:00:00 2001 From: Nicolas Morel Date: Mon, 15 Jan 2024 15:51:53 +0100 Subject: [PATCH 2/2] Apply suggestions from code review --- test/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/index.js b/test/index.js index 382e768..33fbb37 100755 --- a/test/index.js +++ b/test/index.js @@ -2112,6 +2112,7 @@ describe('gunzip', () => { const err = await expect(Wreck.get(`http://localhost:${server.address().port}`, options)).to.reject(); expect(err).to.be.an.error(/Unexpected token/); + expect(Boom.isBoom(err)).to.be.true(); expect(err.data.res.statusCode).to.equal(200); expect(err.data.payload).to.equal(Zlib.gzipSync(JSON.stringify({ foo: 'bar' }))); flags.onCleanup = () => server.close();