@@ -26,54 +26,55 @@ function filterNodes(predicate: (node: ASTNode) => boolean): Array<string> {
2626
2727describe ( 'AST node predicates' , ( ) => {
2828 it ( 'isDefinitionNode' , ( ) => {
29- expect ( filterNodes ( isDefinitionNode ) ) . to . deep . equal ( [
30- 'OperationDefinition' ,
31- 'FragmentDefinition' ,
32- 'SchemaDefinition' ,
33- 'ScalarTypeDefinition' ,
34- 'ObjectTypeDefinition' ,
35- 'InterfaceTypeDefinition' ,
36- 'UnionTypeDefinition' ,
37- 'EnumTypeDefinition' ,
38- 'InputObjectTypeDefinition' ,
39- 'DirectiveDefinition' ,
40- 'SchemaExtension' ,
41- 'ScalarTypeExtension' ,
42- 'ObjectTypeExtension' ,
43- 'InterfaceTypeExtension' ,
44- 'UnionTypeExtension' ,
45- 'EnumTypeExtension' ,
46- 'InputObjectTypeExtension' ,
47- ] ) ;
29+ expect ( filterNodes ( isDefinitionNode ) ) . to . deep . equal (
30+ [
31+ 'OperationDefinition' ,
32+ 'FragmentDefinition' ,
33+ 'SchemaDefinition' ,
34+ 'ScalarTypeDefinition' ,
35+ 'ObjectTypeDefinition' ,
36+ 'InterfaceTypeDefinition' ,
37+ 'UnionTypeDefinition' ,
38+ 'EnumTypeDefinition' ,
39+ 'InputObjectTypeDefinition' ,
40+ 'DirectiveDefinition' ,
41+ 'SchemaExtension' ,
42+ 'ScalarTypeExtension' ,
43+ 'ObjectTypeExtension' ,
44+ 'InterfaceTypeExtension' ,
45+ 'UnionTypeExtension' ,
46+ 'EnumTypeExtension' ,
47+ 'InputObjectTypeExtension' ,
48+ ] . sort ( ) ,
49+ ) ;
4850 } ) ;
4951
5052 it ( 'isExecutableDefinitionNode' , ( ) => {
51- expect ( filterNodes ( isExecutableDefinitionNode ) ) . to . deep . equal ( [
52- 'OperationDefinition' ,
53- 'FragmentDefinition' ,
54- ] ) ;
53+ expect ( filterNodes ( isExecutableDefinitionNode ) ) . to . deep . equal (
54+ [ 'OperationDefinition' , 'FragmentDefinition' ] . sort ( ) ,
55+ ) ;
5556 } ) ;
5657
5758 it ( 'isSelectionNode' , ( ) => {
58- expect ( filterNodes ( isSelectionNode ) ) . to . deep . equal ( [
59- 'Field' ,
60- 'FragmentSpread' ,
61- 'InlineFragment' ,
62- ] ) ;
59+ expect ( filterNodes ( isSelectionNode ) ) . to . deep . equal (
60+ [ 'Field' , 'FragmentSpread' , 'InlineFragment' ] . sort ( ) ,
61+ ) ;
6362 } ) ;
6463
6564 it ( 'isValueNode' , ( ) => {
66- expect ( filterNodes ( isValueNode ) ) . to . deep . equal ( [
67- 'Variable' ,
68- 'IntValue' ,
69- 'FloatValue' ,
70- 'StringValue' ,
71- 'BooleanValue' ,
72- 'NullValue' ,
73- 'EnumValue' ,
74- 'ListValue' ,
75- 'ObjectValue' ,
76- ] ) ;
65+ expect ( filterNodes ( isValueNode ) ) . to . deep . equal (
66+ [
67+ 'Variable' ,
68+ 'IntValue' ,
69+ 'FloatValue' ,
70+ 'StringValue' ,
71+ 'BooleanValue' ,
72+ 'NullValue' ,
73+ 'EnumValue' ,
74+ 'ListValue' ,
75+ 'ObjectValue' ,
76+ ] . sort ( ) ,
77+ ) ;
7778 } ) ;
7879
7980 it ( 'isConstValueNode' , ( ) => {
@@ -88,57 +89,63 @@ describe('AST node predicates', () => {
8889 } ) ;
8990
9091 it ( 'isTypeNode' , ( ) => {
91- expect ( filterNodes ( isTypeNode ) ) . to . deep . equal ( [
92- 'NamedType' ,
93- 'ListType' ,
94- 'NonNullType' ,
95- ] ) ;
92+ expect ( filterNodes ( isTypeNode ) ) . to . deep . equal (
93+ [ 'NamedType' , 'ListType' , 'NonNullType' ] . sort ( ) ,
94+ ) ;
9695 } ) ;
9796
9897 it ( 'isTypeSystemDefinitionNode' , ( ) => {
99- expect ( filterNodes ( isTypeSystemDefinitionNode ) ) . to . deep . equal ( [
100- 'SchemaDefinition' ,
101- 'ScalarTypeDefinition' ,
102- 'ObjectTypeDefinition' ,
103- 'InterfaceTypeDefinition' ,
104- 'UnionTypeDefinition' ,
105- 'EnumTypeDefinition' ,
106- 'InputObjectTypeDefinition' ,
107- 'DirectiveDefinition' ,
108- ] ) ;
98+ expect ( filterNodes ( isTypeSystemDefinitionNode ) ) . to . deep . equal (
99+ [
100+ 'SchemaDefinition' ,
101+ 'ScalarTypeDefinition' ,
102+ 'ObjectTypeDefinition' ,
103+ 'InterfaceTypeDefinition' ,
104+ 'UnionTypeDefinition' ,
105+ 'EnumTypeDefinition' ,
106+ 'InputObjectTypeDefinition' ,
107+ 'DirectiveDefinition' ,
108+ ] . sort ( ) ,
109+ ) ;
109110 } ) ;
110111
111112 it ( 'isTypeDefinitionNode' , ( ) => {
112- expect ( filterNodes ( isTypeDefinitionNode ) ) . to . deep . equal ( [
113- 'ScalarTypeDefinition' ,
114- 'ObjectTypeDefinition' ,
115- 'InterfaceTypeDefinition' ,
116- 'UnionTypeDefinition' ,
117- 'EnumTypeDefinition' ,
118- 'InputObjectTypeDefinition' ,
119- ] ) ;
113+ expect ( filterNodes ( isTypeDefinitionNode ) ) . to . deep . equal (
114+ [
115+ 'ScalarTypeDefinition' ,
116+ 'ObjectTypeDefinition' ,
117+ 'InterfaceTypeDefinition' ,
118+ 'UnionTypeDefinition' ,
119+ 'EnumTypeDefinition' ,
120+ 'InputObjectTypeDefinition' ,
121+ ] . sort ( ) ,
122+ ) ;
120123 } ) ;
121124
122125 it ( 'isTypeSystemExtensionNode' , ( ) => {
123- expect ( filterNodes ( isTypeSystemExtensionNode ) ) . to . deep . equal ( [
124- 'SchemaExtension' ,
125- 'ScalarTypeExtension' ,
126- 'ObjectTypeExtension' ,
127- 'InterfaceTypeExtension' ,
128- 'UnionTypeExtension' ,
129- 'EnumTypeExtension' ,
130- 'InputObjectTypeExtension' ,
131- ] ) ;
126+ expect ( filterNodes ( isTypeSystemExtensionNode ) ) . to . deep . equal (
127+ [
128+ 'SchemaExtension' ,
129+ 'ScalarTypeExtension' ,
130+ 'ObjectTypeExtension' ,
131+ 'InterfaceTypeExtension' ,
132+ 'UnionTypeExtension' ,
133+ 'EnumTypeExtension' ,
134+ 'InputObjectTypeExtension' ,
135+ ] . sort ( ) ,
136+ ) ;
132137 } ) ;
133138
134139 it ( 'isTypeExtensionNode' , ( ) => {
135- expect ( filterNodes ( isTypeExtensionNode ) ) . to . deep . equal ( [
136- 'ScalarTypeExtension' ,
137- 'ObjectTypeExtension' ,
138- 'InterfaceTypeExtension' ,
139- 'UnionTypeExtension' ,
140- 'EnumTypeExtension' ,
141- 'InputObjectTypeExtension' ,
142- ] ) ;
140+ expect ( filterNodes ( isTypeExtensionNode ) ) . to . deep . equal (
141+ [
142+ 'ScalarTypeExtension' ,
143+ 'ObjectTypeExtension' ,
144+ 'InterfaceTypeExtension' ,
145+ 'UnionTypeExtension' ,
146+ 'EnumTypeExtension' ,
147+ 'InputObjectTypeExtension' ,
148+ ] . sort ( ) ,
149+ ) ;
143150 } ) ;
144151} ) ;
0 commit comments