@@ -76,9 +76,7 @@ describe('PropertiesConverter', () => {
7676 const tc = convertToSourceTC ( mapping , 'TestMapping' ) ;
7777 expect ( tc ) . toBeInstanceOf ( TypeComposer ) ;
7878 expect ( tc . getTypeName ( ) ) . toBe ( 'TestMapping' ) ;
79- expect ( tc . getFieldNames ( ) ) . toEqual (
80- expect . arrayContaining ( [ 'name' , 'avatarUrl' ] )
81- ) ;
79+ expect ( tc . getFieldNames ( ) ) . toEqual ( expect . arrayContaining ( [ 'name' , 'avatarUrl' ] ) ) ;
8280 } ) ;
8381
8482 it ( 'should make singular and plural fields' , ( ) => {
@@ -107,40 +105,26 @@ describe('PropertiesConverter', () => {
107105 } ) ;
108106
109107 it ( 'should return GraphQLJSON as fallback for unknown Elastic type' , ( ) => {
110- expect ( propertyToSourceGraphQLType ( { type : 'strange' } ) ) . toEqual (
111- GraphQLJSON
112- ) ;
108+ expect ( propertyToSourceGraphQLType ( { type : 'strange' } ) ) . toEqual ( GraphQLJSON ) ;
113109 } ) ;
114110
115111 it ( 'should return GraphQLInt for int types' , ( ) => {
116- expect ( propertyToSourceGraphQLType ( { type : 'integer' } ) ) . toEqual (
117- GraphQLInt
118- ) ;
112+ expect ( propertyToSourceGraphQLType ( { type : 'integer' } ) ) . toEqual ( GraphQLInt ) ;
119113 expect ( propertyToSourceGraphQLType ( { type : 'long' } ) ) . toEqual ( GraphQLInt ) ;
120114 } ) ;
121115
122116 it ( 'should return GraphQLString for string types' , ( ) => {
123- expect ( propertyToSourceGraphQLType ( { type : 'text' } ) ) . toEqual (
124- GraphQLString
125- ) ;
126- expect ( propertyToSourceGraphQLType ( { type : 'keyword' } ) ) . toEqual (
127- GraphQLString
128- ) ;
117+ expect ( propertyToSourceGraphQLType ( { type : 'text' } ) ) . toEqual ( GraphQLString ) ;
118+ expect ( propertyToSourceGraphQLType ( { type : 'keyword' } ) ) . toEqual ( GraphQLString ) ;
129119 } ) ;
130120
131121 it ( 'should return GraphQLFloat for float types' , ( ) => {
132- expect ( propertyToSourceGraphQLType ( { type : 'float' } ) ) . toEqual (
133- GraphQLFloat
134- ) ;
135- expect ( propertyToSourceGraphQLType ( { type : 'double' } ) ) . toEqual (
136- GraphQLFloat
137- ) ;
122+ expect ( propertyToSourceGraphQLType ( { type : 'float' } ) ) . toEqual ( GraphQLFloat ) ;
123+ expect ( propertyToSourceGraphQLType ( { type : 'double' } ) ) . toEqual ( GraphQLFloat ) ;
138124 } ) ;
139125
140126 it ( 'should return GraphQLBoolean for float types' , ( ) => {
141- expect ( propertyToSourceGraphQLType ( { type : 'boolean' } ) ) . toEqual (
142- GraphQLBoolean
143- ) ;
127+ expect ( propertyToSourceGraphQLType ( { type : 'boolean' } ) ) . toEqual ( GraphQLBoolean ) ;
144128 } ) ;
145129
146130 it ( 'should return GraphQLObjectType for object with subfields' , ( ) => {
@@ -160,9 +144,7 @@ describe('PropertiesConverter', () => {
160144 expect ( type ) . toBeInstanceOf ( GraphQLObjectType ) ;
161145 const tc = TypeComposer . create ( type ) ;
162146 expect ( tc . getTypeName ( ) ) . toEqual ( 'ComplexType' ) ;
163- expect ( tc . getFieldNames ( ) ) . toEqual (
164- expect . arrayContaining ( [ 'big' , 'thumb' ] )
165- ) ;
147+ expect ( tc . getFieldNames ( ) ) . toEqual ( expect . arrayContaining ( [ 'big' , 'thumb' ] ) ) ;
166148 expect ( tc . getFieldType ( 'big' ) ) . toEqual ( GraphQLString ) ;
167149 } ) ;
168150 } ) ;
@@ -205,15 +187,9 @@ describe('PropertiesConverter', () => {
205187 } ,
206188 } ) ;
207189 expect ( Object . keys ( fields . _all ) . length ) . toEqual ( 2 ) ;
208- expect ( Object . keys ( fields . _all ) ) . toEqual (
209- expect . arrayContaining ( [ 'name' , 'name__keyword' ] )
210- ) ;
211- expect ( Object . keys ( fields . keyword ) ) . toEqual (
212- expect . arrayContaining ( [ 'name__keyword' ] )
213- ) ;
214- expect ( Object . keys ( fields . text ) ) . toEqual (
215- expect . arrayContaining ( [ 'name' ] )
216- ) ;
190+ expect ( Object . keys ( fields . _all ) ) . toEqual ( expect . arrayContaining ( [ 'name' , 'name__keyword' ] ) ) ;
191+ expect ( Object . keys ( fields . keyword ) ) . toEqual ( expect . arrayContaining ( [ 'name__keyword' ] ) ) ;
192+ expect ( Object . keys ( fields . text ) ) . toEqual ( expect . arrayContaining ( [ 'name' ] ) ) ;
217193 } ) ;
218194
219195 it ( 'should not return index:false fields' , ( ) => {
@@ -229,21 +205,18 @@ describe('PropertiesConverter', () => {
229205 } ,
230206 } ) ;
231207 expect ( Object . keys ( fields . _all ) . length ) . toEqual ( 1 ) ;
232- expect ( Object . keys ( fields . _all ) ) . toEqual (
233- expect . arrayContaining ( [ 'date' ] )
234- ) ;
208+ expect ( Object . keys ( fields . _all ) ) . toEqual ( expect . arrayContaining ( [ 'date' ] ) ) ;
235209 expect ( Object . keys ( fields . date ) . length ) . toEqual ( 1 ) ;
236- expect ( Object . keys ( fields . date ) ) . toEqual (
237- expect . arrayContaining ( [ 'date' ] )
238- ) ;
210+ expect ( Object . keys ( fields . date ) ) . toEqual ( expect . arrayContaining ( [ 'date' ] ) ) ;
239211 } ) ;
240212 } ) ;
241213
242214 describe ( 'getSubFields()' , ( ) => {
243215 it ( 'should return array of sub fields' , ( ) => {
244- expect (
245- getSubFields ( 'range' , [ 'ok' , 'range' , 'range.min' , 'range.max' ] )
246- ) . toEqual ( [ 'min' , 'max' ] ) ;
216+ expect ( getSubFields ( 'range' , [ 'ok' , 'range' , 'range.min' , 'range.max' ] ) ) . toEqual ( [
217+ 'min' ,
218+ 'max' ,
219+ ] ) ;
247220 } ) ;
248221
249222 it ( 'should return array for empty/undefined list' , ( ) => {
0 commit comments