diff --git a/examples/fastify/__integration-tests__/fastify.spec.ts b/examples/fastify/__integration-tests__/fastify.spec.ts index 1a0ac1a738..19f18df480 100644 --- a/examples/fastify/__integration-tests__/fastify.spec.ts +++ b/examples/fastify/__integration-tests__/fastify.spec.ts @@ -1,6 +1,5 @@ import request from 'supertest'; import { createDeferred } from '@graphql-tools/utils'; -import { fetch } from '@whatwg-node/fetch'; import { eventStream } from '../../../packages/graphql-yoga/__tests__/utilities.js'; import { buildApp } from '../src/app.js'; @@ -281,7 +280,7 @@ data" try { const abortController = new AbortController(); - const response$ = fetch(`${address}/graphql`, { + const response = fetch(`${address}/graphql`, { method: 'POST', headers: { 'content-type': 'application/json', @@ -300,9 +299,9 @@ data" await slowFieldResolverInvoked.promise; abortController.abort(); - await expect(response$).rejects.toMatchInlineSnapshot( - `[AbortError: The operation was aborted]`, - ); + await expect(response).rejects.toMatchObject({ + message: 'This operation was aborted', + }); await slowFieldResolverCanceled.promise; } finally { app.log.info = info; @@ -345,13 +344,13 @@ data" signal: abortController.signal, }); - const iterator = eventStream(response.body!); - const next = await iterator.next(); - expect(next.value).toEqual({ data: { countdown: 10 } }); + const bodyIterator = eventStream(response.body!); + const bodyIteratorNext = await bodyIterator.next(); + expect(bodyIteratorNext.value).toEqual({ data: { countdown: 10 } }); abortController.abort(); - await expect(iterator.next()).rejects.toMatchInlineSnapshot( - `[AbortError: The operation was aborted]`, - ); + await expect(bodyIterator.next()).rejects.toMatchObject({ + message: 'This operation was aborted', + }); await cancelationIsLoggedPromise.promise; } finally { app.log.info = info; diff --git a/examples/fastify/package.json b/examples/fastify/package.json index 837766a893..c3e1ace152 100644 --- a/examples/fastify/package.json +++ b/examples/fastify/package.json @@ -7,7 +7,6 @@ "start": "ts-node src/index.ts" }, "dependencies": { - "@whatwg-node/fetch": "^0.10.1", "fastify": "5.1.0", "graphql-yoga": "workspace:*", "pino-pretty": "13.0.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3c24acfdbf..1dd60df6c9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -494,9 +494,6 @@ importers: examples/fastify: dependencies: - '@whatwg-node/fetch': - specifier: ^0.10.1 - version: 0.10.1 fastify: specifier: 5.1.0 version: 5.1.0 @@ -24201,6 +24198,23 @@ snapshots: '@swc/core-win32-x64-msvc@1.10.1': optional: true + '@swc/core@1.10.1': + dependencies: + '@swc/counter': 0.1.3 + '@swc/types': 0.1.17 + optionalDependencies: + '@swc/core-darwin-arm64': 1.10.1 + '@swc/core-darwin-x64': 1.10.1 + '@swc/core-linux-arm-gnueabihf': 1.10.1 + '@swc/core-linux-arm64-gnu': 1.10.1 + '@swc/core-linux-arm64-musl': 1.10.1 + '@swc/core-linux-x64-gnu': 1.10.1 + '@swc/core-linux-x64-musl': 1.10.1 + '@swc/core-win32-arm64-msvc': 1.10.1 + '@swc/core-win32-ia32-msvc': 1.10.1 + '@swc/core-win32-x64-msvc': 1.10.1 + optional: true + '@swc/core@1.10.1(@swc/helpers@0.5.15)': dependencies: '@swc/counter': 0.1.3 @@ -35366,7 +35380,7 @@ snapshots: v8-compile-cache-lib: 3.0.1 yn: 3.1.1 optionalDependencies: - '@swc/core': 1.10.1(@swc/helpers@0.5.15) + '@swc/core': 1.10.1 ts-node@10.9.2(@swc/core@1.10.1)(@types/node@22.10.1)(typescript@5.7.2): dependencies: