File: graphql%2B17.0.0-alpha.3.patch

package info (click to toggle)
golang-github-graph-gophers-graphql-go 1.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 1,452 kB
  • sloc: sh: 373; javascript: 21; makefile: 5
file content (473 lines) | stat: -rw-r--r-- 20,809 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
diff --git a/node_modules/graphql/src/validation/__tests__/FieldsOnCorrectTypeRule-test.ts b/node_modules/graphql/src/validation/__tests__/FieldsOnCorrectTypeRule-test.ts
index 1c7fbc0..1771fff 100644
--- a/node_modules/graphql/src/validation/__tests__/FieldsOnCorrectTypeRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/FieldsOnCorrectTypeRule-test.ts
@@ -1,5 +1,4 @@
 import { expect } from 'chai';
-import { describe, it } from 'mocha';
 
 import { parse } from '../../language/parser.js';
 
@@ -10,7 +9,7 @@ import { buildSchema } from '../../utilities/buildASTSchema.js';
 import { FieldsOnCorrectTypeRule } from '../rules/FieldsOnCorrectTypeRule.js';
 import { validate } from '../validate.js';
 
-import { expectValidationErrorsWithSchema } from './harness.js';
+import { describe, it, expectValidationErrorsWithSchema } from './harness.js';
 
 function expectErrors(queryStr: string) {
   return expectValidationErrorsWithSchema(
diff --git a/node_modules/graphql/src/validation/__tests__/FragmentsOnCompositeTypesRule-test.ts b/node_modules/graphql/src/validation/__tests__/FragmentsOnCompositeTypesRule-test.ts
index 849b662..1e37004 100644
--- a/node_modules/graphql/src/validation/__tests__/FragmentsOnCompositeTypesRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/FragmentsOnCompositeTypesRule-test.ts
@@ -1,8 +1,6 @@
-import { describe, it } from 'mocha';
-
 import { FragmentsOnCompositeTypesRule } from '../rules/FragmentsOnCompositeTypesRule.js';
 
-import { expectValidationErrors } from './harness.js';
+import { describe, it, expectValidationErrors } from './harness.js';
 
 function expectErrors(queryStr: string) {
   return expectValidationErrors(FragmentsOnCompositeTypesRule, queryStr);
diff --git a/node_modules/graphql/src/validation/__tests__/KnownArgumentNamesRule-test.ts b/node_modules/graphql/src/validation/__tests__/KnownArgumentNamesRule-test.ts
index 0fcffec..8aa40d3 100644
--- a/node_modules/graphql/src/validation/__tests__/KnownArgumentNamesRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/KnownArgumentNamesRule-test.ts
@@ -1,5 +1,3 @@
-import { describe, it } from 'mocha';
-
 import type { GraphQLSchema } from '../../type/schema.js';
 
 import { buildSchema } from '../../utilities/buildASTSchema.js';
@@ -10,6 +8,8 @@ import {
 } from '../rules/KnownArgumentNamesRule.js';
 
 import {
+  describe,
+  it,
   expectSDLValidationErrors,
   expectValidationErrors,
 } from './harness.js';
diff --git a/node_modules/graphql/src/validation/__tests__/KnownDirectivesRule-test.ts b/node_modules/graphql/src/validation/__tests__/KnownDirectivesRule-test.ts
index a3bbc19..7b04bba 100644
--- a/node_modules/graphql/src/validation/__tests__/KnownDirectivesRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/KnownDirectivesRule-test.ts
@@ -1,5 +1,3 @@
-import { describe, it } from 'mocha';
-
 import type { GraphQLSchema } from '../../type/schema.js';
 
 import { buildSchema } from '../../utilities/buildASTSchema.js';
@@ -7,6 +5,8 @@ import { buildSchema } from '../../utilities/buildASTSchema.js';
 import { KnownDirectivesRule } from '../rules/KnownDirectivesRule.js';
 
 import {
+  describe,
+  it,
   expectSDLValidationErrors,
   expectValidationErrorsWithSchema,
 } from './harness.js';
diff --git a/node_modules/graphql/src/validation/__tests__/KnownFragmentNamesRule-test.ts b/node_modules/graphql/src/validation/__tests__/KnownFragmentNamesRule-test.ts
index ad0158b..bc5a356 100644
--- a/node_modules/graphql/src/validation/__tests__/KnownFragmentNamesRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/KnownFragmentNamesRule-test.ts
@@ -1,8 +1,6 @@
-import { describe, it } from 'mocha';
-
 import { KnownFragmentNamesRule } from '../rules/KnownFragmentNamesRule.js';
 
-import { expectValidationErrors } from './harness.js';
+import { describe, it, expectValidationErrors } from './harness.js';
 
 function expectErrors(queryStr: string) {
   return expectValidationErrors(KnownFragmentNamesRule, queryStr);
diff --git a/node_modules/graphql/src/validation/__tests__/KnownTypeNamesRule-test.ts b/node_modules/graphql/src/validation/__tests__/KnownTypeNamesRule-test.ts
index 0440c09..69d950a 100644
--- a/node_modules/graphql/src/validation/__tests__/KnownTypeNamesRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/KnownTypeNamesRule-test.ts
@@ -1,5 +1,3 @@
-import { describe, it } from 'mocha';
-
 import type { GraphQLSchema } from '../../type/schema.js';
 
 import { buildSchema } from '../../utilities/buildASTSchema.js';
@@ -7,6 +5,8 @@ import { buildSchema } from '../../utilities/buildASTSchema.js';
 import { KnownTypeNamesRule } from '../rules/KnownTypeNamesRule.js';
 
 import {
+  describe,
+  it,
   expectSDLValidationErrors,
   expectValidationErrors,
   expectValidationErrorsWithSchema,
diff --git a/node_modules/graphql/src/validation/__tests__/LoneAnonymousOperationRule-test.ts b/node_modules/graphql/src/validation/__tests__/LoneAnonymousOperationRule-test.ts
index f60750b..df1d288 100644
--- a/node_modules/graphql/src/validation/__tests__/LoneAnonymousOperationRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/LoneAnonymousOperationRule-test.ts
@@ -1,8 +1,6 @@
-import { describe, it } from 'mocha';
-
 import { LoneAnonymousOperationRule } from '../rules/LoneAnonymousOperationRule.js';
 
-import { expectValidationErrors } from './harness.js';
+import { describe, it, expectValidationErrors } from './harness.js';
 
 function expectErrors(queryStr: string) {
   return expectValidationErrors(LoneAnonymousOperationRule, queryStr);
diff --git a/node_modules/graphql/src/validation/__tests__/NoFragmentCyclesRule-test.ts b/node_modules/graphql/src/validation/__tests__/NoFragmentCyclesRule-test.ts
index 69f951c..f1da380 100644
--- a/node_modules/graphql/src/validation/__tests__/NoFragmentCyclesRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/NoFragmentCyclesRule-test.ts
@@ -1,8 +1,6 @@
-import { describe, it } from 'mocha';
-
 import { NoFragmentCyclesRule } from '../rules/NoFragmentCyclesRule.js';
 
-import { expectValidationErrors } from './harness.js';
+import { describe, it, expectValidationErrors } from './harness.js';
 
 function expectErrors(queryStr: string) {
   return expectValidationErrors(NoFragmentCyclesRule, queryStr);
diff --git a/node_modules/graphql/src/validation/__tests__/NoUndefinedVariablesRule-test.ts b/node_modules/graphql/src/validation/__tests__/NoUndefinedVariablesRule-test.ts
index c6ed758..920df75 100644
--- a/node_modules/graphql/src/validation/__tests__/NoUndefinedVariablesRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/NoUndefinedVariablesRule-test.ts
@@ -1,8 +1,6 @@
-import { describe, it } from 'mocha';
-
 import { NoUndefinedVariablesRule } from '../rules/NoUndefinedVariablesRule.js';
 
-import { expectValidationErrors } from './harness.js';
+import { describe, it, expectValidationErrors } from './harness.js';
 
 function expectErrors(queryStr: string) {
   return expectValidationErrors(NoUndefinedVariablesRule, queryStr);
diff --git a/node_modules/graphql/src/validation/__tests__/NoUnusedFragmentsRule-test.ts b/node_modules/graphql/src/validation/__tests__/NoUnusedFragmentsRule-test.ts
index d20f99e..75cda8b 100644
--- a/node_modules/graphql/src/validation/__tests__/NoUnusedFragmentsRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/NoUnusedFragmentsRule-test.ts
@@ -1,8 +1,6 @@
-import { describe, it } from 'mocha';
-
 import { NoUnusedFragmentsRule } from '../rules/NoUnusedFragmentsRule.js';
 
-import { expectValidationErrors } from './harness.js';
+import { describe, it, expectValidationErrors } from './harness.js';
 
 function expectErrors(queryStr: string) {
   return expectValidationErrors(NoUnusedFragmentsRule, queryStr);
diff --git a/node_modules/graphql/src/validation/__tests__/NoUnusedVariablesRule-test.ts b/node_modules/graphql/src/validation/__tests__/NoUnusedVariablesRule-test.ts
index 47dac39..96b0e3e 100644
--- a/node_modules/graphql/src/validation/__tests__/NoUnusedVariablesRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/NoUnusedVariablesRule-test.ts
@@ -1,8 +1,6 @@
-import { describe, it } from 'mocha';
-
 import { NoUnusedVariablesRule } from '../rules/NoUnusedVariablesRule.js';
 
-import { expectValidationErrors } from './harness.js';
+import { describe, it, expectValidationErrors } from './harness.js';
 
 function expectErrors(queryStr: string) {
   return expectValidationErrors(NoUnusedVariablesRule, queryStr);
diff --git a/node_modules/graphql/src/validation/__tests__/OverlappingFieldsCanBeMergedRule-test.ts b/node_modules/graphql/src/validation/__tests__/OverlappingFieldsCanBeMergedRule-test.ts
index ecb56a1..cde5f38 100644
--- a/node_modules/graphql/src/validation/__tests__/OverlappingFieldsCanBeMergedRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/OverlappingFieldsCanBeMergedRule-test.ts
@@ -1,5 +1,3 @@
-import { describe, it } from 'mocha';
-
 import type { GraphQLSchema } from '../../type/schema.js';
 
 import { buildSchema } from '../../utilities/buildASTSchema.js';
@@ -7,6 +5,8 @@ import { buildSchema } from '../../utilities/buildASTSchema.js';
 import { OverlappingFieldsCanBeMergedRule } from '../rules/OverlappingFieldsCanBeMergedRule.js';
 
 import {
+  describe,
+  it,
   expectValidationErrors,
   expectValidationErrorsWithSchema,
 } from './harness.js';
diff --git a/node_modules/graphql/src/validation/__tests__/PossibleFragmentSpreadsRule-test.ts b/node_modules/graphql/src/validation/__tests__/PossibleFragmentSpreadsRule-test.ts
index bd3bb63..2633a2f 100644
--- a/node_modules/graphql/src/validation/__tests__/PossibleFragmentSpreadsRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/PossibleFragmentSpreadsRule-test.ts
@@ -1,10 +1,8 @@
-import { describe, it } from 'mocha';
-
 import { buildSchema } from '../../utilities/buildASTSchema.js';
 
 import { PossibleFragmentSpreadsRule } from '../rules/PossibleFragmentSpreadsRule.js';
 
-import { expectValidationErrorsWithSchema } from './harness.js';
+import { describe, it, expectValidationErrorsWithSchema } from './harness.js';
 
 function expectErrors(queryStr: string) {
   return expectValidationErrorsWithSchema(
diff --git a/node_modules/graphql/src/validation/__tests__/ProvidedRequiredArgumentsRule-test.ts b/node_modules/graphql/src/validation/__tests__/ProvidedRequiredArgumentsRule-test.ts
index 6f0d223..fb7101e 100644
--- a/node_modules/graphql/src/validation/__tests__/ProvidedRequiredArgumentsRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/ProvidedRequiredArgumentsRule-test.ts
@@ -1,5 +1,3 @@
-import { describe, it } from 'mocha';
-
 import type { GraphQLSchema } from '../../type/schema.js';
 
 import { buildSchema } from '../../utilities/buildASTSchema.js';
@@ -10,6 +8,8 @@ import {
 } from '../rules/ProvidedRequiredArgumentsRule.js';
 
 import {
+  describe,
+  it,
   expectSDLValidationErrors,
   expectValidationErrors,
 } from './harness.js';
diff --git a/node_modules/graphql/src/validation/__tests__/ScalarLeafsRule-test.ts b/node_modules/graphql/src/validation/__tests__/ScalarLeafsRule-test.ts
index fd000b9..279bbe5 100644
--- a/node_modules/graphql/src/validation/__tests__/ScalarLeafsRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/ScalarLeafsRule-test.ts
@@ -1,8 +1,6 @@
-import { describe, it } from 'mocha';
-
 import { ScalarLeafsRule } from '../rules/ScalarLeafsRule.js';
 
-import { expectValidationErrors } from './harness.js';
+import { describe, it, expectValidationErrors } from './harness.js';
 
 function expectErrors(queryStr: string) {
   return expectValidationErrors(ScalarLeafsRule, queryStr);
diff --git a/node_modules/graphql/src/validation/__tests__/UniqueArgumentNamesRule-test.ts b/node_modules/graphql/src/validation/__tests__/UniqueArgumentNamesRule-test.ts
index 8a08f98..bf8c4a7 100644
--- a/node_modules/graphql/src/validation/__tests__/UniqueArgumentNamesRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/UniqueArgumentNamesRule-test.ts
@@ -1,8 +1,6 @@
-import { describe, it } from 'mocha';
-
 import { UniqueArgumentNamesRule } from '../rules/UniqueArgumentNamesRule.js';
 
-import { expectValidationErrors } from './harness.js';
+import { describe, it, expectValidationErrors } from './harness.js';
 
 function expectErrors(queryStr: string) {
   return expectValidationErrors(UniqueArgumentNamesRule, queryStr);
diff --git a/node_modules/graphql/src/validation/__tests__/UniqueDirectivesPerLocationRule-test.ts b/node_modules/graphql/src/validation/__tests__/UniqueDirectivesPerLocationRule-test.ts
index fd67ff8..ff54aa3 100644
--- a/node_modules/graphql/src/validation/__tests__/UniqueDirectivesPerLocationRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/UniqueDirectivesPerLocationRule-test.ts
@@ -1,5 +1,3 @@
-import { describe, it } from 'mocha';
-
 import { parse } from '../../language/parser.js';
 
 import type { GraphQLSchema } from '../../type/schema.js';
@@ -9,6 +7,8 @@ import { extendSchema } from '../../utilities/extendSchema.js';
 import { UniqueDirectivesPerLocationRule } from '../rules/UniqueDirectivesPerLocationRule.js';
 
 import {
+  describe,
+  it,
   expectSDLValidationErrors,
   expectValidationErrorsWithSchema,
   testSchema,
diff --git a/node_modules/graphql/src/validation/__tests__/UniqueFragmentNamesRule-test.ts b/node_modules/graphql/src/validation/__tests__/UniqueFragmentNamesRule-test.ts
index 30b0f5f..515c220 100644
--- a/node_modules/graphql/src/validation/__tests__/UniqueFragmentNamesRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/UniqueFragmentNamesRule-test.ts
@@ -1,8 +1,6 @@
-import { describe, it } from 'mocha';
-
 import { UniqueFragmentNamesRule } from '../rules/UniqueFragmentNamesRule.js';
 
-import { expectValidationErrors } from './harness.js';
+import { describe, it, expectValidationErrors } from './harness.js';
 
 function expectErrors(queryStr: string) {
   return expectValidationErrors(UniqueFragmentNamesRule, queryStr);
diff --git a/node_modules/graphql/src/validation/__tests__/UniqueInputFieldNamesRule-test.ts b/node_modules/graphql/src/validation/__tests__/UniqueInputFieldNamesRule-test.ts
index 3dc56ff..1e2cc24 100644
--- a/node_modules/graphql/src/validation/__tests__/UniqueInputFieldNamesRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/UniqueInputFieldNamesRule-test.ts
@@ -1,8 +1,6 @@
-import { describe, it } from 'mocha';
-
 import { UniqueInputFieldNamesRule } from '../rules/UniqueInputFieldNamesRule.js';
 
-import { expectValidationErrors } from './harness.js';
+import { describe, it, expectValidationErrors } from './harness.js';
 
 function expectErrors(queryStr: string) {
   return expectValidationErrors(UniqueInputFieldNamesRule, queryStr);
diff --git a/node_modules/graphql/src/validation/__tests__/UniqueOperationNamesRule-test.ts b/node_modules/graphql/src/validation/__tests__/UniqueOperationNamesRule-test.ts
index ef24487..17f8e56 100644
--- a/node_modules/graphql/src/validation/__tests__/UniqueOperationNamesRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/UniqueOperationNamesRule-test.ts
@@ -1,8 +1,6 @@
-import { describe, it } from 'mocha';
-
 import { UniqueOperationNamesRule } from '../rules/UniqueOperationNamesRule.js';
 
-import { expectValidationErrors } from './harness.js';
+import { describe, it, expectValidationErrors } from './harness.js';
 
 function expectErrors(queryStr: string) {
   return expectValidationErrors(UniqueOperationNamesRule, queryStr);
diff --git a/node_modules/graphql/src/validation/__tests__/UniqueVariableNamesRule-test.ts b/node_modules/graphql/src/validation/__tests__/UniqueVariableNamesRule-test.ts
index f23c778..3b74faf 100644
--- a/node_modules/graphql/src/validation/__tests__/UniqueVariableNamesRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/UniqueVariableNamesRule-test.ts
@@ -1,8 +1,6 @@
-import { describe, it } from 'mocha';
-
 import { UniqueVariableNamesRule } from '../rules/UniqueVariableNamesRule.js';
 
-import { expectValidationErrors } from './harness.js';
+import { describe, it, expectValidationErrors } from './harness.js';
 
 function expectErrors(queryStr: string) {
   return expectValidationErrors(UniqueVariableNamesRule, queryStr);
diff --git a/node_modules/graphql/src/validation/__tests__/VariablesAreInputTypesRule-test.ts b/node_modules/graphql/src/validation/__tests__/VariablesAreInputTypesRule-test.ts
index 8027a35..1305c6d 100644
--- a/node_modules/graphql/src/validation/__tests__/VariablesAreInputTypesRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/VariablesAreInputTypesRule-test.ts
@@ -1,8 +1,6 @@
-import { describe, it } from 'mocha';
-
 import { VariablesAreInputTypesRule } from '../rules/VariablesAreInputTypesRule.js';
 
-import { expectValidationErrors } from './harness.js';
+import { describe, it, expectValidationErrors } from './harness.js';
 
 function expectErrors(queryStr: string) {
   return expectValidationErrors(VariablesAreInputTypesRule, queryStr);
diff --git a/node_modules/graphql/src/validation/__tests__/VariablesInAllowedPositionRule-test.ts b/node_modules/graphql/src/validation/__tests__/VariablesInAllowedPositionRule-test.ts
index 1646774..a4358db 100644
--- a/node_modules/graphql/src/validation/__tests__/VariablesInAllowedPositionRule-test.ts
+++ b/node_modules/graphql/src/validation/__tests__/VariablesInAllowedPositionRule-test.ts
@@ -1,8 +1,6 @@
-import { describe, it } from 'mocha';
-
 import { VariablesInAllowedPositionRule } from '../rules/VariablesInAllowedPositionRule.js';
 
-import { expectValidationErrors } from './harness.js';
+import { describe, it, expectValidationErrors } from './harness.js';
 
 function expectErrors(queryStr: string) {
   return expectValidationErrors(VariablesInAllowedPositionRule, queryStr);
diff --git a/node_modules/graphql/src/validation/__tests__/harness.ts b/node_modules/graphql/src/validation/__tests__/harness.ts
index b7710ff..8287c61 100644
--- a/node_modules/graphql/src/validation/__tests__/harness.ts
+++ b/node_modules/graphql/src/validation/__tests__/harness.ts
@@ -8,7 +8,7 @@ import type { GraphQLSchema } from '../../type/schema.js';
 
 import { buildSchema } from '../../utilities/buildASTSchema.js';
 
-import { validate, validateSDL } from '../validate.js';
+import { validateSDL } from '../validate.js';
 import type {
   SDLValidationRule,
   ValidationRule,
@@ -124,29 +124,89 @@ export const testSchema: GraphQLSchema = buildSchema(`
   directive @onField on FIELD
 `);
 
+let _schemas: GraphQLSchema[] = [];
+function registerSchema(schema: GraphQLSchema) {
+  for (let i = 0; i < _schemas.length; i++) {
+    if (_schemas[i] == schema) {
+      return i;
+    }
+  }
+  _schemas.push(schema);
+  return _schemas.length - 1;
+}
+
+type Test = {
+  name: string,
+  rule: string,
+  schema: number,
+  query: string,
+  errors: any[],
+};
+
+let tests: Test[]  = [];
+let names: string[] = [];
+
 export function expectValidationErrorsWithSchema(
-  schema: GraphQLSchema,
-  rule: ValidationRule,
-  queryStr: string,
+    schema: GraphQLSchema,
+    rule: ValidationRule,
+    queryStr: string,
 ): any {
-  const doc = parse(queryStr);
-  const errors = validate(schema, doc, [rule]);
-  return expectJSON(errors);
+  return {
+    toDeepEqual: (errors: any[]) => {
+      return tests.push({
+        name: names.join('/'),
+        rule: rule.name,
+        schema: registerSchema(schema),
+        query: queryStr,
+        errors: errors,
+      });
+    }
+  }
 }
 
 export function expectValidationErrors(
-  rule: ValidationRule,
-  queryStr: string,
+    rule: ValidationRule,
+    queryStr: string,
 ): any {
   return expectValidationErrorsWithSchema(testSchema, rule, queryStr);
 }
 
 export function expectSDLValidationErrors(
-  schema: Maybe<GraphQLSchema>,
-  rule: SDLValidationRule,
-  sdlStr: string,
+    schema: Maybe<GraphQLSchema>,
+    rule: SDLValidationRule,
+    sdlStr: string,
 ): any {
   const doc = parse(sdlStr);
   const errors = validateSDL(doc, schema, [rule]);
   return expectJSON(errors);
 }
+
+export function describe(name: string, f: Function) {
+  switch (name) {
+    case 'within schema language':
+      return;
+  }
+  names.push(name);
+  f();
+  names.pop();
+}
+
+export function it(name: string, f: Function) {
+  switch (name) {
+    case 'ignores type definitions':
+    case 'reports correctly when a non-exclusive follows an exclusive':
+    case 'disallows differing subfields':
+      return;
+  }
+  names.push(name);
+  f();
+  names.pop();
+}
+
+export function schemas(): GraphQLSchema[] {
+  return _schemas;
+}
+
+export function testCases(): Test[] {
+  return tests;
+}