Skip to content

Commit b3b1b04

Browse files
committed
tests: in expect chains use '.to.not.' instead of '.not.to.'
1 parent 576682f commit b3b1b04

File tree

4 files changed

+51
-51
lines changed

4 files changed

+51
-51
lines changed

src/language/__tests__/lexer-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ describe('Lexer', () => {
879879
endToken = lexer.advance();
880880
// Lexer advances over ignored comment tokens to make writing parsers
881881
// easier, but will include them in the linked list result.
882-
expect(endToken.kind).not.to.equal(TokenKind.COMMENT);
882+
expect(endToken.kind).to.not.equal(TokenKind.COMMENT);
883883
} while (endToken.kind !== TokenKind.EOF);
884884

885885
expect(startToken.prev).to.equal(null);

src/type/__tests__/definition-test.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const NonNullListOfScalars = GraphQLNonNull(ListOfScalarsType);
4141

4242
describe('Type System: Scalars', () => {
4343
it('accepts a Scalar type defining serialize', () => {
44-
expect(() => new GraphQLScalarType({ name: 'SomeScalar' })).not.to.throw();
44+
expect(() => new GraphQLScalarType({ name: 'SomeScalar' })).to.not.throw();
4545
});
4646

4747
it('accepts a Scalar type defining parseValue and parseLiteral', () => {
@@ -52,7 +52,7 @@ describe('Type System: Scalars', () => {
5252
parseValue: () => null,
5353
parseLiteral: () => null,
5454
}),
55-
).not.to.throw();
55+
).to.not.throw();
5656
});
5757

5858
it('provides default methods if omitted', () => {
@@ -291,7 +291,7 @@ describe('Type System: Objects', () => {
291291
},
292292
},
293293
});
294-
expect(() => objType.getFields()).not.to.throw();
294+
expect(() => objType.getFields()).to.not.throw();
295295
});
296296

297297
it('rejects an Object type field with undefined config', () => {
@@ -438,7 +438,7 @@ describe('Type System: Interfaces', () => {
438438
name: 'AnotherInterface',
439439
fields: { f: { type: ScalarType } },
440440
}),
441-
).not.to.throw();
441+
).to.not.throw();
442442
});
443443

444444
it('accepts an Interface type with an array of interfaces', () => {
@@ -508,7 +508,7 @@ describe('Type System: Unions', () => {
508508
name: 'SomeUnion',
509509
types: [ObjectType],
510510
}),
511-
).not.to.throw();
511+
).to.not.throw();
512512
});
513513

514514
it('accepts a Union type with array types', () => {
@@ -801,14 +801,14 @@ describe('Type System: List', () => {
801801
}
802802

803803
it('accepts an type as item type of list', () => {
804-
expectList(ScalarType).not.to.throw();
805-
expectList(ObjectType).not.to.throw();
806-
expectList(UnionType).not.to.throw();
807-
expectList(InterfaceType).not.to.throw();
808-
expectList(EnumType).not.to.throw();
809-
expectList(InputObjectType).not.to.throw();
810-
expectList(ListOfScalarsType).not.to.throw();
811-
expectList(NonNullScalarType).not.to.throw();
804+
expectList(ScalarType).to.not.throw();
805+
expectList(ObjectType).to.not.throw();
806+
expectList(UnionType).to.not.throw();
807+
expectList(InterfaceType).to.not.throw();
808+
expectList(EnumType).to.not.throw();
809+
expectList(InputObjectType).to.not.throw();
810+
expectList(ListOfScalarsType).to.not.throw();
811+
expectList(NonNullScalarType).to.not.throw();
812812
});
813813

814814
it('rejects a non-type as item type of list', () => {
@@ -831,14 +831,14 @@ describe('Type System: Non-Null', () => {
831831
}
832832

833833
it('accepts an type as nullable type of non-null', () => {
834-
expectNonNull(ScalarType).not.to.throw();
835-
expectNonNull(ObjectType).not.to.throw();
836-
expectNonNull(UnionType).not.to.throw();
837-
expectNonNull(InterfaceType).not.to.throw();
838-
expectNonNull(EnumType).not.to.throw();
839-
expectNonNull(InputObjectType).not.to.throw();
840-
expectNonNull(ListOfScalarsType).not.to.throw();
841-
expectNonNull(ListOfNonNullScalarsType).not.to.throw();
834+
expectNonNull(ScalarType).to.not.throw();
835+
expectNonNull(ObjectType).to.not.throw();
836+
expectNonNull(UnionType).to.not.throw();
837+
expectNonNull(InterfaceType).to.not.throw();
838+
expectNonNull(EnumType).to.not.throw();
839+
expectNonNull(InputObjectType).to.not.throw();
840+
expectNonNull(ListOfScalarsType).to.not.throw();
841+
expectNonNull(ListOfNonNullScalarsType).to.not.throw();
842842
});
843843

844844
it('rejects a non-type as nullable type of non-null', () => {

src/type/__tests__/predicate-test.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ describe('Type predicates', () => {
9090
describe('isType', () => {
9191
it('returns true for unwrapped types', () => {
9292
expect(isType(GraphQLString)).to.equal(true);
93-
expect(() => assertType(GraphQLString)).not.to.throw();
93+
expect(() => assertType(GraphQLString)).to.not.throw();
9494
expect(isType(ObjectType)).to.equal(true);
95-
expect(() => assertType(ObjectType)).not.to.throw();
95+
expect(() => assertType(ObjectType)).to.not.throw();
9696
});
9797

9898
it('returns true for wrapped types', () => {
9999
expect(isType(GraphQLNonNull(GraphQLString))).to.equal(true);
100-
expect(() => assertType(GraphQLNonNull(GraphQLString))).not.to.throw();
100+
expect(() => assertType(GraphQLNonNull(GraphQLString))).to.not.throw();
101101
});
102102

103103
it('returns false for type classes (rather than instances)', () => {
@@ -114,12 +114,12 @@ describe('Type predicates', () => {
114114
describe('isScalarType', () => {
115115
it('returns true for spec defined scalar', () => {
116116
expect(isScalarType(GraphQLString)).to.equal(true);
117-
expect(() => assertScalarType(GraphQLString)).not.to.throw();
117+
expect(() => assertScalarType(GraphQLString)).to.not.throw();
118118
});
119119

120120
it('returns true for custom scalar', () => {
121121
expect(isScalarType(ScalarType)).to.equal(true);
122-
expect(() => assertScalarType(ScalarType)).not.to.throw();
122+
expect(() => assertScalarType(ScalarType)).to.not.throw();
123123
});
124124

125125
it('returns false for scalar class (rather than instance)', () => {
@@ -162,7 +162,7 @@ describe('Type predicates', () => {
162162
describe('isObjectType', () => {
163163
it('returns true for object type', () => {
164164
expect(isObjectType(ObjectType)).to.equal(true);
165-
expect(() => assertObjectType(ObjectType)).not.to.throw();
165+
expect(() => assertObjectType(ObjectType)).to.not.throw();
166166
});
167167

168168
it('returns false for wrapped object type', () => {
@@ -179,7 +179,7 @@ describe('Type predicates', () => {
179179
describe('isInterfaceType', () => {
180180
it('returns true for interface type', () => {
181181
expect(isInterfaceType(InterfaceType)).to.equal(true);
182-
expect(() => assertInterfaceType(InterfaceType)).not.to.throw();
182+
expect(() => assertInterfaceType(InterfaceType)).to.not.throw();
183183
});
184184

185185
it('returns false for wrapped interface type', () => {
@@ -196,7 +196,7 @@ describe('Type predicates', () => {
196196
describe('isUnionType', () => {
197197
it('returns true for union type', () => {
198198
expect(isUnionType(UnionType)).to.equal(true);
199-
expect(() => assertUnionType(UnionType)).not.to.throw();
199+
expect(() => assertUnionType(UnionType)).to.not.throw();
200200
});
201201

202202
it('returns false for wrapped union type', () => {
@@ -213,7 +213,7 @@ describe('Type predicates', () => {
213213
describe('isEnumType', () => {
214214
it('returns true for enum type', () => {
215215
expect(isEnumType(EnumType)).to.equal(true);
216-
expect(() => assertEnumType(EnumType)).not.to.throw();
216+
expect(() => assertEnumType(EnumType)).to.not.throw();
217217
});
218218

219219
it('returns false for wrapped enum type', () => {
@@ -230,7 +230,7 @@ describe('Type predicates', () => {
230230
describe('isInputObjectType', () => {
231231
it('returns true for input object type', () => {
232232
expect(isInputObjectType(InputObjectType)).to.equal(true);
233-
expect(() => assertInputObjectType(InputObjectType)).not.to.throw();
233+
expect(() => assertInputObjectType(InputObjectType)).to.not.throw();
234234
});
235235

236236
it('returns false for wrapped input object type', () => {
@@ -249,7 +249,7 @@ describe('Type predicates', () => {
249249
describe('isListType', () => {
250250
it('returns true for a list wrapped type', () => {
251251
expect(isListType(GraphQLList(ObjectType))).to.equal(true);
252-
expect(() => assertListType(GraphQLList(ObjectType))).not.to.throw();
252+
expect(() => assertListType(GraphQLList(ObjectType))).to.not.throw();
253253
});
254254

255255
it('returns false for an unwrapped type', () => {
@@ -272,7 +272,7 @@ describe('Type predicates', () => {
272272
expect(isNonNullType(GraphQLNonNull(ObjectType))).to.equal(true);
273273
expect(() =>
274274
assertNonNullType(GraphQLNonNull(ObjectType)),
275-
).not.to.throw();
275+
).to.not.throw();
276276
});
277277

278278
it('returns false for an unwrapped type', () => {
@@ -293,7 +293,7 @@ describe('Type predicates', () => {
293293
describe('isInputType', () => {
294294
function expectInputType(type) {
295295
expect(isInputType(type)).to.equal(true);
296-
expect(() => assertInputType(type)).not.to.throw();
296+
expect(() => assertInputType(type)).to.not.throw();
297297
}
298298

299299
it('returns true for an input type', () => {
@@ -337,7 +337,7 @@ describe('Type predicates', () => {
337337
describe('isOutputType', () => {
338338
function expectOutputType(type) {
339339
expect(isOutputType(type)).to.equal(true);
340-
expect(() => assertOutputType(type)).not.to.throw();
340+
expect(() => assertOutputType(type)).to.not.throw();
341341
}
342342

343343
it('returns true for an output type', () => {
@@ -380,9 +380,9 @@ describe('Type predicates', () => {
380380
describe('isLeafType', () => {
381381
it('returns true for scalar and enum types', () => {
382382
expect(isLeafType(ScalarType)).to.equal(true);
383-
expect(() => assertLeafType(ScalarType)).not.to.throw();
383+
expect(() => assertLeafType(ScalarType)).to.not.throw();
384384
expect(isLeafType(EnumType)).to.equal(true);
385-
expect(() => assertLeafType(EnumType)).not.to.throw();
385+
expect(() => assertLeafType(EnumType)).to.not.throw();
386386
});
387387

388388
it('returns false for wrapped leaf type', () => {
@@ -404,11 +404,11 @@ describe('Type predicates', () => {
404404
describe('isCompositeType', () => {
405405
it('returns true for object, interface, and union types', () => {
406406
expect(isCompositeType(ObjectType)).to.equal(true);
407-
expect(() => assertCompositeType(ObjectType)).not.to.throw();
407+
expect(() => assertCompositeType(ObjectType)).to.not.throw();
408408
expect(isCompositeType(InterfaceType)).to.equal(true);
409-
expect(() => assertCompositeType(InterfaceType)).not.to.throw();
409+
expect(() => assertCompositeType(InterfaceType)).to.not.throw();
410410
expect(isCompositeType(UnionType)).to.equal(true);
411-
expect(() => assertCompositeType(UnionType)).not.to.throw();
411+
expect(() => assertCompositeType(UnionType)).to.not.throw();
412412
});
413413

414414
it('returns false for wrapped composite type', () => {
@@ -432,9 +432,9 @@ describe('Type predicates', () => {
432432
describe('isAbstractType', () => {
433433
it('returns true for interface and union types', () => {
434434
expect(isAbstractType(InterfaceType)).to.equal(true);
435-
expect(() => assertAbstractType(InterfaceType)).not.to.throw();
435+
expect(() => assertAbstractType(InterfaceType)).to.not.throw();
436436
expect(isAbstractType(UnionType)).to.equal(true);
437-
expect(() => assertAbstractType(UnionType)).not.to.throw();
437+
expect(() => assertAbstractType(UnionType)).to.not.throw();
438438
});
439439

440440
it('returns false for wrapped abstract type', () => {
@@ -456,11 +456,11 @@ describe('Type predicates', () => {
456456
describe('isWrappingType', () => {
457457
it('returns true for list and non-null types', () => {
458458
expect(isWrappingType(GraphQLList(ObjectType))).to.equal(true);
459-
expect(() => assertWrappingType(GraphQLList(ObjectType))).not.to.throw();
459+
expect(() => assertWrappingType(GraphQLList(ObjectType))).to.not.throw();
460460
expect(isWrappingType(GraphQLNonNull(ObjectType))).to.equal(true);
461461
expect(() =>
462462
assertWrappingType(GraphQLNonNull(ObjectType)),
463-
).not.to.throw();
463+
).to.not.throw();
464464
});
465465

466466
it('returns false for unwrapped types', () => {
@@ -472,7 +472,7 @@ describe('Type predicates', () => {
472472
describe('isNullableType', () => {
473473
it('returns true for unwrapped types', () => {
474474
expect(isNullableType(ObjectType)).to.equal(true);
475-
expect(() => assertNullableType(ObjectType)).not.to.throw();
475+
expect(() => assertNullableType(ObjectType)).to.not.throw();
476476
});
477477

478478
it('returns true for list of non-null types', () => {
@@ -481,7 +481,7 @@ describe('Type predicates', () => {
481481
);
482482
expect(() =>
483483
assertNullableType(GraphQLList(GraphQLNonNull(ObjectType))),
484-
).not.to.throw();
484+
).to.not.throw();
485485
});
486486

487487
it('returns false for non-null types', () => {
@@ -510,7 +510,7 @@ describe('Type predicates', () => {
510510
describe('isNamedType', () => {
511511
it('returns true for unwrapped types', () => {
512512
expect(isNamedType(ObjectType)).to.equal(true);
513-
expect(() => assertNamedType(ObjectType)).not.to.throw();
513+
expect(() => assertNamedType(ObjectType)).to.not.throw();
514514
});
515515

516516
it('returns false for list and non-null types', () => {
@@ -636,12 +636,12 @@ describe('Directive predicates', () => {
636636
describe('isDirective', () => {
637637
it('returns true for spec defined directive', () => {
638638
expect(isDirective(GraphQLSkipDirective)).to.equal(true);
639-
expect(() => assertDirective(GraphQLSkipDirective)).not.to.throw();
639+
expect(() => assertDirective(GraphQLSkipDirective)).to.not.throw();
640640
});
641641

642642
it('returns true for custom directive', () => {
643643
expect(isDirective(Directive)).to.equal(true);
644-
expect(() => assertDirective(Directive)).not.to.throw();
644+
expect(() => assertDirective(Directive)).to.not.throw();
645645
});
646646

647647
it('returns false for directive class (rather than instance)', () => {

src/utilities/__tests__/buildClientSchema-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ describe('Type System: build schema from introspection', () => {
140140

141141
// Custom are built
142142
const customScalar = schema.getType('CustomScalar');
143-
expect(clientSchema.getType('CustomScalar')).not.to.equal(customScalar);
143+
expect(clientSchema.getType('CustomScalar')).to.not.equal(customScalar);
144144
});
145145

146146
it('includes standard types only if they are used', () => {

0 commit comments

Comments
 (0)