Skip to content

Commit 7d207c0

Browse files
committed
drop altogether
1 parent e06b30c commit 7d207c0

File tree

1 file changed

+33
-79
lines changed

1 file changed

+33
-79
lines changed

packages/federation/tests/federation-compatibility.test.ts

Lines changed: 33 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,20 @@ import {
55
GatewayRuntime,
66
useCustomFetch,
77
} from '@graphql-hive/gateway-runtime';
8-
import { normalizedExecutor } from '@graphql-tools/executor';
98
import {
109
ExecutionResult,
1110
filterSchema,
1211
getDirective,
1312
MapperKind,
1413
mapSchema,
1514
} from '@graphql-tools/utils';
16-
import { assertSingleExecutionValue } from '@internal/testing';
1715
import {
1816
buildSchema,
1917
getNamedType,
2018
GraphQLSchema,
2119
isEnumType,
2220
lexicographicSortSchema,
23-
parse,
2421
printSchema,
25-
validate,
2622
} from 'graphql';
2723
import { createRouter } from 'graphql-federation-gateway-audit';
2824
import { beforeAll, describe, expect, it } from 'vitest';
@@ -154,84 +150,42 @@ describe('Federation Compatibility', () => {
154150
);
155151
});
156152
tests.forEach((_, i) => {
157-
describe(`test-query-${i}`, () => {
158-
// TODO: audit tests are not idempotent anymore, we need to restart the subgraphs
159-
// it('gives the correct result w/ core', async () => {
160-
// const test = tests[i];
161-
// if (!test) {
162-
// throw new Error(`Test ${i} not found`);
163-
// }
164-
// const document = parse(test.query, { noLocation: true });
165-
// const validationErrors = validate(stitchedSchema, document);
166-
// let result: ExecutionResult;
167-
// if (validationErrors.length > 0) {
168-
// result = {
169-
// errors: validationErrors,
170-
// };
171-
// } else {
172-
// const execRes = await normalizedExecutor({
173-
// schema: stitchedSchema,
174-
// document,
175-
// });
176-
// assertSingleExecutionValue(execRes);
177-
// result = execRes;
178-
// }
179-
// const received = {
180-
// data: result.data ?? null,
181-
// errors: !!result.errors?.length,
182-
// };
183-
184-
// const expected = {
185-
// data: test.expected.data ?? null,
186-
// errors: test.expected.errors ?? false,
187-
// };
188-
189-
// try {
190-
// expect(received).toEqual(expected);
191-
// } catch (e) {
192-
// result.errors?.forEach((err) => {
193-
// console.error(err);
194-
// });
195-
// throw e;
196-
// }
197-
// });
198-
it('gives the correct result w/ gateway', async () => {
199-
const test = tests[i];
200-
if (!test) {
201-
throw new Error(`Test ${i} not found`);
202-
}
203-
const response = await gatewayRuntime.fetch(
204-
'http://localhost/graphql',
205-
{
206-
method: 'POST',
207-
headers: {
208-
'content-type': 'application/json',
209-
},
210-
body: JSON.stringify({
211-
query: test.query,
212-
}),
153+
it(`test-query-${i}`, async () => {
154+
const test = tests[i];
155+
if (!test) {
156+
throw new Error(`Test ${i} not found`);
157+
}
158+
const response = await gatewayRuntime.fetch(
159+
'http://localhost/graphql',
160+
{
161+
method: 'POST',
162+
headers: {
163+
'content-type': 'application/json',
213164
},
214-
);
215-
const result: ExecutionResult = await response.json();
216-
const received = {
217-
data: result.data ?? null,
218-
errors: !!result.errors?.length,
219-
};
165+
body: JSON.stringify({
166+
query: test.query,
167+
}),
168+
},
169+
);
170+
const result: ExecutionResult = await response.json();
171+
const received = {
172+
data: result.data ?? null,
173+
errors: !!result.errors?.length,
174+
};
220175

221-
const expected = {
222-
data: test.expected.data ?? null,
223-
errors: test.expected.errors ?? false,
224-
};
176+
const expected = {
177+
data: test.expected.data ?? null,
178+
errors: test.expected.errors ?? false,
179+
};
225180

226-
try {
227-
expect(received).toEqual(expected);
228-
} catch (e) {
229-
result.errors?.forEach((err) => {
230-
console.error(err);
231-
});
232-
throw e;
233-
}
234-
});
181+
try {
182+
expect(received).toEqual(expected);
183+
} catch (e) {
184+
result.errors?.forEach((err) => {
185+
console.error(err);
186+
});
187+
throw e;
188+
}
235189
});
236190
});
237191
});

0 commit comments

Comments
 (0)