From 29a2a7f6edb27ed5447627068c3b5237f1ffeb55 Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Mon, 25 Apr 2022 16:23:25 +0300 Subject: [PATCH] test: fix failing integration tests on node@18 Context: https://github.com/nodejs/node/pull/41431#discussion_r841272416 --- .circleci/config.yml | 1 + .../server/src/__tests__/integration/apolloServerTests.ts | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8012addc7fe..fd22d90d91c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -87,6 +87,7 @@ workflows: - "14" - "16" - "17" + - "18" - "Check for FIXM\x45" - Prettier - Spell check diff --git a/packages/server/src/__tests__/integration/apolloServerTests.ts b/packages/server/src/__tests__/integration/apolloServerTests.ts index 42447d7f8ac..90964f87700 100644 --- a/packages/server/src/__tests__/integration/apolloServerTests.ts +++ b/packages/server/src/__tests__/integration/apolloServerTests.ts @@ -934,7 +934,8 @@ export function defineIntegrationTestSuiteApolloServerTests( const { family, address, port } = this.server.address() as AddressInfo; - if (family !== 'IPv4') { + // @ts-expect-error until https://github.com/DefinitelyTyped/DefinitelyTyped/pull/60042 + if (family !== 'IPv4' && family !== 4) { throw new Error(`The family was unexpectedly ${family}.`); } return new URL(`http://${address}:${port}`).toString(); @@ -1959,7 +1960,8 @@ export function defineIntegrationTestSuiteApolloServerTests( const { family, address, port } = fakeUsageReportingServer.address() as AddressInfo; - if (family !== 'IPv4') { + // @ts-expect-error until https://github.com/DefinitelyTyped/DefinitelyTyped/pull/60042 + if (family !== 'IPv4' && family !== 4) { throw new Error(`The family was unexpectedly ${family}.`); }