Skip to content

Commit

Permalink
Make tests resilient to new Node default connection header changes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pimterry committed Aug 28, 2023
1 parent 2f41556 commit dea1b2c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/integration/subscriptions/request-events.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const INCONSISTENT_HEADERS = [
'origin',
'referer',

// Varies on browser vs various Node versions:
'connection',

// Varies on OS config:
'accept-language',

Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit dea1b2c

Please sign in to comment.