@@ -45,9 +45,11 @@ describe('fieldConverter', () => {
4545
4646 it ( 'should throw Exception, if model does `schema.path` property' , ( ) => {
4747 expect ( ( ) => {
48+ // $FlowFixMe
4849 getFieldsFromModel ( { a : 1 } ) ;
4950 } ) . toThrowError ( / i n c o r r e c t m o n g o o s e m o d e l / ) ;
5051 expect ( ( ) => {
52+ // $FlowFixMe
5153 getFieldsFromModel ( { schema : { } } ) ;
5254 } ) . toThrowError ( / i n c o r r e c t m o n g o o s e m o d e l / ) ;
5355 } ) ;
@@ -57,15 +59,19 @@ describe('fieldConverter', () => {
5759 it ( 'should throw error on incorrect mongoose field' , ( ) => {
5860 const err = / i n c o r r e c t m o n g o o s e f i e l d / ;
5961 expect ( ( ) => {
62+ // $FlowFixMe
6063 deriveComplexType ( ) ;
6164 } ) . toThrowError ( err ) ;
6265 expect ( ( ) => {
66+ // $FlowFixMe
6367 deriveComplexType ( 123 ) ;
6468 } ) . toThrowError ( err ) ;
6569 expect ( ( ) => {
70+ // $FlowFixMe
6671 deriveComplexType ( { a : 1 } ) ;
6772 } ) . toThrowError ( err ) ;
6873 expect ( ( ) => {
74+ // $FlowFixMe
6975 deriveComplexType ( { path : 'name' } ) ;
7076 } ) . toThrowError ( err ) ;
7177 expect ( ( ) => {
@@ -90,7 +96,9 @@ describe('fieldConverter', () => {
9096
9197 it ( 'schould derive ENUM' , ( ) => {
9298 expect ( deriveComplexType ( fields . gender ) ) . toBe ( ComplexTypes . ENUM ) ;
99+ // $FlowFixMe
93100 expect ( deriveComplexType ( fields . languages . schema . paths . ln ) ) . toBe ( ComplexTypes . ENUM ) ;
101+ // $FlowFixMe
94102 expect ( deriveComplexType ( fields . languages . schema . paths . sk ) ) . toBe ( ComplexTypes . ENUM ) ;
95103 } ) ;
96104
@@ -146,6 +154,7 @@ describe('fieldConverter', () => {
146154
147155 it ( 'should has string in ofType' , ( ) => {
148156 const skillsType = arrayToGraphQL ( fields . skills ) ;
157+ // $FlowFixMe
149158 expect ( skillsType . ofType . name ) . toBe ( 'String' ) ;
150159 } ) ;
151160 } ) ;
@@ -163,7 +172,9 @@ describe('fieldConverter', () => {
163172
164173 it ( 'should pass all enum values to GQ type' , ( ) => {
165174 const genderEnum = enumToGraphQL ( fields . gender ) ;
175+ // $FlowFixMe
166176 expect ( genderEnum . _values . length ) . toBe ( fields . gender . enumValues . length ) ;
177+ // $FlowFixMe
167178 expect ( genderEnum . _values [ 0 ] . value ) . toBe ( fields . gender . enumValues [ 0 ] ) ;
168179 } ) ;
169180 } ) ;
@@ -176,6 +187,7 @@ describe('fieldConverter', () => {
176187
177188 it ( 'should have embedded fields' , ( ) => {
178189 const embeddedType = embeddedToGraphQL ( fields . contacts ) ;
190+ // $FlowFixMe
179191 const embeddedFields = embeddedType . _typeConfig . fields ( ) ;
180192 expect ( embeddedFields . email ) . toBeTruthy ( ) ;
181193 expect ( embeddedFields . locationId ) . toBeTruthy ( ) ;
@@ -211,6 +223,7 @@ describe('fieldConverter', () => {
211223 }
212224 }`
213225 ) ;
226+ // $FlowFixMe
214227 expect ( result . data . user ) . toEqual ( {
215228 name : 'Test empty subDoc' ,
216229 subDoc : null ,
@@ -253,6 +266,7 @@ describe('fieldConverter', () => {
253266 }
254267 }`
255268 ) ;
269+ // $FlowFixMe
256270 expect ( result2 . data . user ) . toEqual ( {
257271 name : 'Test non empty subDoc' ,
258272 subDoc : {
@@ -265,6 +279,7 @@ describe('fieldConverter', () => {
265279
266280 describe ( 'documentArrayToGraphQL()' , ( ) => {
267281 const languagesType = documentArrayToGraphQL ( fields . languages ) ;
282+ // $FlowFixMe
268283 const languagesFields = languagesType . ofType . _typeConfig . fields ( ) ;
269284
270285 it ( 'should produce GraphQLList' , ( ) => {
@@ -273,6 +288,7 @@ describe('fieldConverter', () => {
273288
274289 it ( 'should has Language type in ofType' , ( ) => {
275290 // see src/__mocks__/languageSchema.js where type name `Language` is defined
291+ // $FlowFixMe
276292 expect ( languagesType . ofType . name ) . toBe ( 'Language' ) ;
277293 } ) ;
278294
@@ -323,7 +339,9 @@ describe('fieldConverter', () => {
323339 }
324340 }` ;
325341 const result = await graphql . graphql ( schema , query ) ;
342+ // $FlowFixMe
326343 expect ( result . data . user . name ) . toBe ( user . name ) ;
344+ // $FlowFixMe
327345 expect ( result . data . user . someDynamic ) . toEqual ( user . someDynamic ) ;
328346 } ) ;
329347 } ) ;
0 commit comments