Skip to content

Commit

Permalink
use test in favor of it, remove await from test
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Apr 3, 2024
1 parent b508a5a commit cde42f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ await describe(
networkStatus: 7,
};

await test(
test(
"`useSuspenseQuery`: data is getting sent to the transport",
{ skip: outsideOf("node") },
async () => {
Expand Down Expand Up @@ -144,7 +144,7 @@ await describe(
}
);

await test(
test(
"`useSuspenseQuery`: data from the transport is used by the hooks",
{ skip: outsideOf("browser") },
async () => {
Expand Down Expand Up @@ -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,
Expand All @@ -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 () => {
Expand All @@ -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 () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
import { runInConditions } from "./util/runInConditions.js";

Expand Down Expand Up @@ -51,7 +51,7 @@ const queryWithDeferAndStripAnnotation = gql`
}
`;

it("removes fields with a @defer directive", () => {
test("removes fields with a @defer directive", () => {
const link = new RemoveMultipartDirectivesLink({
stripDefer: true,
});
Expand All @@ -69,7 +69,7 @@ query myQuery {
);
});

it("`stripDefer` defaults to `true`", () => {
test("`stripDefer` defaults to `true`", () => {
const link = new RemoveMultipartDirectivesLink({
stripDefer: true,
});
Expand All @@ -87,7 +87,7 @@ query myQuery {
);
});

it("preserves @defer fields with a `SsrDontStrip` label", () => {
test("preserves @defer fields with a `SsrDontStrip` label", () => {
const link = new RemoveMultipartDirectivesLink({
stripDefer: true,
});
Expand All @@ -114,7 +114,7 @@ query myQuery {
);
});

it("can be configured to not remove @defer fields", () => {
test("can be configured to not remove @defer fields", () => {
const link = new RemoveMultipartDirectivesLink({
stripDefer: false,
});
Expand All @@ -138,7 +138,7 @@ query myQuery {
);
});

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,
});
Expand Down

0 comments on commit cde42f4

Please sign in to comment.