Skip to content

Commit

Permalink
use test in favor of it, remove await from test (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas authored Apr 3, 2024
1 parent e60f1ec commit fd40453
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";

const { RemoveMultipartDirectivesLink } = await import("#bundled");
Expand Down Expand Up @@ -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,
});
Expand All @@ -66,7 +66,7 @@ query myQuery {
);
});

await it("`stripDefer` defaults to `true`", () => {
test("`stripDefer` defaults to `true`", () => {
const link = new RemoveMultipartDirectivesLink({
stripDefer: true,
});
Expand All @@ -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,
});
Expand All @@ -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,
});
Expand All @@ -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,
});
Expand Down

0 comments on commit fd40453

Please sign in to comment.