Skip to content

Commit

Permalink
Run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Nov 1, 2021
1 parent 3a7a971 commit 77d4bb3
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 23 deletions.
6 changes: 1 addition & 5 deletions src/__benchmarks__/benchmarks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async function runBenchmarks() {
console.error(`${bench} failed to compile`);
return null;
}

console.log(
`size of function for ${bench}: ${
(compiledQuery as any)
Expand Down Expand Up @@ -138,11 +138,9 @@ async function runBenchmarks() {
})
// add listeners
.on("cycle", (event: any) => {

console.log(String(event.target));
})
.on("start", () => {

console.log("Starting", bench);
});
return suite;
Expand All @@ -162,12 +160,10 @@ async function runBenchmarks() {
if (benchsToRun.length > 0) {
benchsToRun[0].run();
} else {

console.log("No benchmarks to run");
}
}


runBenchmarks().catch(console.error);

function isNotNull<T>(a: T | null | undefined): a is T {
Expand Down
9 changes: 4 additions & 5 deletions src/__tests__/abstract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class Human {
constructor(public name: string, public pets?: any) {}
}


describe("Execute: Handles execution of abstract types", () => {
test("isTypeOf used to resolve runtime type for Interface", () => {
const PetType = new GraphQLInterfaceType({
Expand Down Expand Up @@ -306,7 +305,7 @@ describe("Execute: Handles execution of abstract types", () => {

const PetType = new GraphQLUnionType({
name: "Pet",

resolveType(obj) {
return obj instanceof Dog
? DogType
Expand All @@ -325,7 +324,7 @@ describe("Execute: Handles execution of abstract types", () => {
fields: {
pets: {
type: new GraphQLList(PetType),

resolve() {
return [
new Dog("Odie", true),
Expand Down Expand Up @@ -528,7 +527,7 @@ describe("Execute: Handles execution of abstract types", () => {
friend: {
type: new GraphQLUnionType({
name: "DogFriend",

resolveType(obj) {
return obj instanceof Dog
? DogType
Expand All @@ -552,7 +551,7 @@ describe("Execute: Handles execution of abstract types", () => {

const PetType = new GraphQLUnionType({
name: "Pet",

resolveType(obj) {
return obj instanceof Dog
? DogType
Expand Down
4 changes: 0 additions & 4 deletions src/__tests__/directives.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ function executeTestQuery(query: string, variables = {}, schema = testSchema) {
return compiled.query(data, undefined, variables);
}


describe("Execute: handles directives", () => {
describe("works without directives", () => {
test("basic query works", () => {
Expand All @@ -49,7 +48,6 @@ describe("Execute: handles directives", () => {
});

describe("works on scalars", () => {

test("if true includes scalar", () => {
const result = executeTestQuery("{ a, b @include(if: true) }");

Expand All @@ -66,7 +64,6 @@ describe("Execute: handles directives", () => {
});
});


test("unless false includes scalar", () => {
const result = executeTestQuery("{ a, b @skip(if: false) }");

Expand All @@ -75,7 +72,6 @@ describe("Execute: handles directives", () => {
});
});


test("unless true omits scalar", () => {
const result = executeTestQuery("{ a, b @skip(if: true) }");

Expand Down
4 changes: 1 addition & 3 deletions src/__tests__/execution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ describe("Execute: Handles basic execution tasks", () => {
throw new Error("Error getting asyncError");
});
},

asyncRawError() {
return new Promise(() => {
/* eslint-disable */
Expand Down Expand Up @@ -686,7 +686,6 @@ describe("Execute: Handles basic execution tasks", () => {
expect(result).toEqual({ data: { a: "b" } });
});


test("uses the only operation if no operation name is provided", async () => {
const doc = "query Example { a }";
const data = { a: "b" };
Expand Down Expand Up @@ -748,7 +747,6 @@ describe("Execute: Handles basic execution tasks", () => {
});
});


test("errors if no op name is provided with multiple operations", async () => {
const doc = "query Example { a } query OtherExample { a }";
const data = { a: "b" };
Expand Down
2 changes: 0 additions & 2 deletions src/__tests__/lists.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ describe("Execute: Accepts any iterable as list value", () => {
const containsValues = "Contains values";
const containsNull = "Contains null";


describe("Execute: Handles list nullability", () => {
describe("[T]", () => {
const type = new GraphQLList(GraphQLInt);
Expand Down Expand Up @@ -276,7 +275,6 @@ describe("Execute: Handles list nullability", () => {
);
});


describe("Array<Promise<T>>", () => {
test(
containsValues,
Expand Down
2 changes: 0 additions & 2 deletions src/__tests__/nonnull.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ function patch(data: any) {
);
}


async function executeSyncAndAsync(query: string, rootValue: any) {
const syncResult = await executeQuery(query, rootValue);
const asyncResult = await executeQuery(patch(query), rootValue);
Expand All @@ -160,7 +159,6 @@ async function executeSyncAndAsync(query: string, rootValue: any) {
return syncResult;
}


describe("Execute: handles non-nullable types", () => {
describe("nulls a nullable field", () => {
const query = `
Expand Down
1 change: 0 additions & 1 deletion src/__tests__/union-interface.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ const odie = new Dog("Odie", true);
const liz = new Person("Liz");
const john = new Person("John", [garfield, odie], [liz, odie]);


describe("Execute: Union and intersection types", () => {
test("can introspect on union and intersection types", () => {
const ast = parse(`
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/variables.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const TestComplexScalar = new GraphQLScalarType({
}
return null;
},

parseValue(value: any) {
if (value === "SerializedValue") {
return "DeserializedValue";
Expand Down

0 comments on commit 77d4bb3

Please sign in to comment.