From dea1b2cffc251b6f7ad4d61fd298513ff1cb7f8e Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Mon, 28 Aug 2023 15:05:13 +0100 Subject: [PATCH] Make tests resilient to new Node default connection header changes It seems that Node v20.5.1 sets this to keep-alive by default, but not in all environments? Seeing keep-alive in GitHub but not locally with the same release. Doesn't matter for this test, best to just ignore it. --- test/integration/subscriptions/request-events.spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/integration/subscriptions/request-events.spec.ts b/test/integration/subscriptions/request-events.spec.ts index 4a99eea62..8aa4f850d 100644 --- a/test/integration/subscriptions/request-events.spec.ts +++ b/test/integration/subscriptions/request-events.spec.ts @@ -26,6 +26,9 @@ const INCONSISTENT_HEADERS = [ 'origin', 'referer', + // Varies on browser vs various Node versions: + 'connection', + // Varies on OS config: 'accept-language', @@ -69,7 +72,6 @@ describe("Request initiated subscriptions", () => { const matchableHeaders = _.omit(seenRequest.headers, INCONSISTENT_HEADERS); expect(matchableHeaders).to.deep.equal({ - 'connection': isNode ? 'close' : 'keep-alive', 'accept': '*/*', 'content-length': '9', 'content-type': 'text/plain;charset=UTF-8', @@ -166,7 +168,6 @@ describe("Request initiated subscriptions", () => { const matchableHeaders = _.omit(seenRequest.headers, INCONSISTENT_HEADERS); expect(matchableHeaders).to.deep.equal({ - 'connection': isNode ? 'close' : 'keep-alive', 'accept': '*/*', 'content-length': '9', 'content-type': 'text/plain;charset=UTF-8',