@@ -19,8 +19,8 @@ import { Parser } from '../../Parser';
1919describe ( 'Directive tests on parser' , ( ) => {
2020 test ( `${ TypeSystemDefinition . DirectiveDefinition } - directive keyword on ${ Directive . OBJECT } ` , ( ) => {
2121 const schema = `
22- directive @model on ${ Directive . OBJECT }
2322 type Person @model
23+ directive @model on ${ Directive . OBJECT }
2424 ` ;
2525 const tree = Parser . parse ( schema ) ;
2626 const treeMock : ParserTree = {
@@ -74,7 +74,7 @@ describe('Directive tests on parser', () => {
7474 } ,
7575 ] ,
7676 } ;
77- expect ( tree . nodes ) . toEqual ( treeMock . nodes ) ;
77+ expect ( tree . nodes ) . toEqual ( expect . arrayContaining ( treeMock . nodes ) ) ;
7878 } ) ;
7979 test ( `${ TypeSystemDefinition . DirectiveDefinition } - directive keyword on ${ Directive . FIELD_DEFINITION } ` , ( ) => {
8080 const schema = `
@@ -151,7 +151,7 @@ describe('Directive tests on parser', () => {
151151 } ,
152152 ] ,
153153 } ;
154- expect ( tree . nodes ) . toEqual ( treeMock . nodes ) ;
154+ expect ( tree . nodes ) . toEqual ( expect . arrayContaining ( treeMock . nodes ) ) ;
155155 } ) ;
156156 test ( `${ TypeSystemDefinition . DirectiveDefinition } - directive keyword on ${ Directive . ARGUMENT_DEFINITION } ` , ( ) => {
157157 const schema = `
@@ -244,7 +244,7 @@ describe('Directive tests on parser', () => {
244244 } ,
245245 ] ,
246246 } ;
247- expect ( tree . nodes ) . toEqual ( treeMock . nodes ) ;
247+ expect ( tree . nodes ) . toEqual ( expect . arrayContaining ( treeMock . nodes ) ) ;
248248 } ) ;
249249 test ( `${ TypeSystemDefinition . DirectiveDefinition } - directive keyword on ${ Directive . INTERFACE } ` , ( ) => {
250250 const schema = `
@@ -303,7 +303,7 @@ describe('Directive tests on parser', () => {
303303 } ,
304304 ] ,
305305 } ;
306- expect ( tree . nodes ) . toEqual ( treeMock . nodes ) ;
306+ expect ( tree . nodes ) . toEqual ( expect . arrayContaining ( treeMock . nodes ) ) ;
307307 } ) ;
308308 test ( `${ TypeSystemDefinition . DirectiveDefinition } - directive keyword on ${ Directive . UNION } ` , ( ) => {
309309 const schema = `
@@ -425,7 +425,7 @@ describe('Directive tests on parser', () => {
425425 } ,
426426 ] ,
427427 } ;
428- expect ( tree . nodes ) . toEqual ( treeMock . nodes ) ;
428+ expect ( tree . nodes ) . toEqual ( expect . arrayContaining ( treeMock . nodes ) ) ;
429429 } ) ;
430430 test ( `${ TypeSystemDefinition . DirectiveDefinition } - directive keyword on ${ Directive . ENUM } ` , ( ) => {
431431 const schema = `
@@ -484,7 +484,7 @@ describe('Directive tests on parser', () => {
484484 } ,
485485 ] ,
486486 } ;
487- expect ( tree . nodes ) . toEqual ( treeMock . nodes ) ;
487+ expect ( tree . nodes ) . toEqual ( expect . arrayContaining ( treeMock . nodes ) ) ;
488488 } ) ;
489489 test ( `${ TypeSystemDefinition . DirectiveDefinition } - directive keyword on ${ Directive . ENUM_VALUE } ` , ( ) => {
490490 const schema = `
@@ -577,7 +577,7 @@ describe('Directive tests on parser', () => {
577577 } ,
578578 ] ,
579579 } ;
580- expect ( tree . nodes ) . toEqual ( treeMock . nodes ) ;
580+ expect ( tree . nodes ) . toEqual ( expect . arrayContaining ( treeMock . nodes ) ) ;
581581 } ) ;
582582 test ( `${ TypeSystemDefinition . DirectiveDefinition } - directive keyword on ${ Directive . INPUT_OBJECT } ` , ( ) => {
583583 const schema = `
@@ -636,14 +636,14 @@ describe('Directive tests on parser', () => {
636636 } ,
637637 ] ,
638638 } ;
639- expect ( tree . nodes ) . toEqual ( treeMock . nodes ) ;
639+ expect ( tree . nodes ) . toEqual ( expect . arrayContaining ( treeMock . nodes ) ) ;
640640 } ) ;
641641 test ( `${ TypeSystemDefinition . DirectiveDefinition } - directive keyword on ${ Directive . INPUT_FIELD_DEFINITION } ` , ( ) => {
642642 const schema = `
643- directive @model on ${ Directive . INPUT_FIELD_DEFINITION }
644643 input Person{
645- name: String
644+ name: String @model
646645 }
646+ directive @model on ${ Directive . INPUT_FIELD_DEFINITION }
647647 ` ;
648648 const tree = Parser . parse ( schema ) ;
649649 const treeMock : ParserTree = {
@@ -713,7 +713,7 @@ describe('Directive tests on parser', () => {
713713 } ,
714714 ] ,
715715 } ;
716- expect ( tree . nodes ) . toEqual ( treeMock . nodes ) ;
716+ expect ( tree . nodes ) . toEqual ( expect . arrayContaining ( treeMock . nodes ) ) ;
717717 } ) ;
718718 test ( `${ TypeSystemDefinition . DirectiveDefinition } - directive keyword on ${ Directive . SCALAR } ` , ( ) => {
719719 const schema = `
@@ -772,7 +772,7 @@ describe('Directive tests on parser', () => {
772772 } ,
773773 ] ,
774774 } ;
775- expect ( tree . nodes ) . toEqual ( treeMock . nodes ) ;
775+ expect ( tree . nodes ) . toEqual ( expect . arrayContaining ( treeMock . nodes ) ) ;
776776 } ) ;
777777 test ( `${ TypeSystemDefinition . DirectiveDefinition } - directive keyword on ${ Directive . OBJECT } with input arguments` , ( ) => {
778778 const schema = `
@@ -813,7 +813,7 @@ describe('Directive tests on parser', () => {
813813 } ,
814814 } ,
815815 data : {
816- type : TypeSystemDefinition . FieldDefinition ,
816+ type : ValueDefinition . InputValueDefinition ,
817817 } ,
818818 directives : [ ] ,
819819 interfaces : [ ] ,
@@ -828,7 +828,7 @@ describe('Directive tests on parser', () => {
828828 } ,
829829 } ,
830830 data : {
831- type : TypeSystemDefinition . FieldDefinition ,
831+ type : ValueDefinition . InputValueDefinition ,
832832 } ,
833833 directives : [ ] ,
834834 args : [ ] ,
@@ -843,7 +843,7 @@ describe('Directive tests on parser', () => {
843843 } ,
844844 } ,
845845 data : {
846- type : TypeSystemDefinition . FieldDefinition ,
846+ type : ValueDefinition . InputValueDefinition ,
847847 } ,
848848 args : [ ] ,
849849 directives : [ ] ,
@@ -1061,6 +1061,6 @@ describe('Directive tests on parser', () => {
10611061 } ,
10621062 ] ,
10631063 } ;
1064- expect ( tree . nodes ) . toEqual ( treeMock . nodes ) ;
1064+ expect ( tree . nodes ) . toEqual ( expect . arrayContaining ( treeMock . nodes ) ) ;
10651065 } ) ;
10661066} ) ;
0 commit comments