From fd40453f707e6b5184795a7a4706bb3f44a041b8 Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Wed, 3 Apr 2024 10:56:27 +0200 Subject: [PATCH] use `test` in favor of `it`, remove `await` from `test` (#267) --- .../WrappedApolloClient.test.tsx | 10 +++++----- .../src/RemoveMultipartDirectivesLink.test.ts | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/client-react-streaming/src/DataTransportAbstraction/WrappedApolloClient.test.tsx b/packages/client-react-streaming/src/DataTransportAbstraction/WrappedApolloClient.test.tsx index 1551a6f0..12890984 100644 --- a/packages/client-react-streaming/src/DataTransportAbstraction/WrappedApolloClient.test.tsx +++ b/packages/client-react-streaming/src/DataTransportAbstraction/WrappedApolloClient.test.tsx @@ -67,7 +67,7 @@ await describe( networkStatus: 7, }; - await test( + test( "`useSuspenseQuery`: data is getting sent to the transport", { skip: outsideOf("node") }, async () => { @@ -144,7 +144,7 @@ await describe( } ); - await test( + test( "`useSuspenseQuery`: data from the transport is used by the hooks", { skip: outsideOf("browser") }, async () => { @@ -269,7 +269,7 @@ await describe("document transforms are applied correctly", async () => { }, }) ); - await test("when making a request", async () => { + test("when making a request", async () => { const link = new MockSubscriptionLink(); const client = new ApolloClient({ connectToDevTools: false, @@ -286,7 +286,7 @@ await describe("document transforms are applied correctly", async () => { assert.equal(print(link.operation!.query), print(transformedQuery)); }); - await test( + test( "when rerunning queries when connection is closed", { skip: outsideOf("browser") }, async () => { @@ -313,7 +313,7 @@ await describe("document transforms are applied correctly", async () => { } ); - await test( + test( "when rerunning a query that failed on the server", { skip: outsideOf("browser") }, async () => { diff --git a/packages/client-react-streaming/src/RemoveMultipartDirectivesLink.test.ts b/packages/client-react-streaming/src/RemoveMultipartDirectivesLink.test.ts index 02a6adc0..e322d140 100644 --- a/packages/client-react-streaming/src/RemoveMultipartDirectivesLink.test.ts +++ b/packages/client-react-streaming/src/RemoveMultipartDirectivesLink.test.ts @@ -3,7 +3,7 @@ import { fromPartial } from "@total-typescript/shoehorn"; import type { DocumentNode } from "@apollo/client/index.js"; import { gql, Observable } from "@apollo/client/core/index.js"; import { print } from "graphql"; -import { it } from "node:test"; +import { test } from "node:test"; import assert from "node:assert"; const { RemoveMultipartDirectivesLink } = await import("#bundled"); @@ -48,7 +48,7 @@ const queryWithDeferAndStripAnnotation = gql` } `; -await it("removes fields with a @defer directive", () => { +test("removes fields with a @defer directive", () => { const link = new RemoveMultipartDirectivesLink({ stripDefer: true, }); @@ -66,7 +66,7 @@ query myQuery { ); }); -await it("`stripDefer` defaults to `true`", () => { +test("`stripDefer` defaults to `true`", () => { const link = new RemoveMultipartDirectivesLink({ stripDefer: true, }); @@ -84,7 +84,7 @@ query myQuery { ); }); -await it("preserves @defer fields with a `SsrDontStrip` label", () => { +test("preserves @defer fields with a `SsrDontStrip` label", () => { const link = new RemoveMultipartDirectivesLink({ stripDefer: true, }); @@ -111,7 +111,7 @@ query myQuery { ); }); -await it("can be configured to not remove @defer fields", () => { +test("can be configured to not remove @defer fields", () => { const link = new RemoveMultipartDirectivesLink({ stripDefer: false, }); @@ -135,7 +135,7 @@ query myQuery { ); }); -await it("even with `stripDefer: false`, certain fields can be marked for stripping", () => { +test("even with `stripDefer: false`, certain fields can be marked for stripping", () => { const link = new RemoveMultipartDirectivesLink({ stripDefer: false, });