@@ -414,52 +414,6 @@ describe('Type System: Objects', () => {
414414 } ) ;
415415 expect ( ( ) => objType . getFields ( ) ) . to . not . throw ( ) ;
416416 } ) ;
417-
418- it ( 'rejects an Object type with invalid name' , ( ) => {
419- expect (
420- ( ) => new GraphQLObjectType ( { name : 'bad-name' , fields : { } } ) ,
421- ) . to . throw ( 'Names must only contain [_a-zA-Z0-9] but "bad-name" does not.' ) ;
422- } ) ;
423-
424- it ( 'rejects an Object type with incorrectly named fields' , ( ) => {
425- const objType = new GraphQLObjectType ( {
426- name : 'SomeObject' ,
427- fields : {
428- 'bad-name' : { type : ScalarType } ,
429- } ,
430- } ) ;
431- expect ( ( ) => objType . getFields ( ) ) . to . throw (
432- 'Names must only contain [_a-zA-Z0-9] but "bad-name" does not.' ,
433- ) ;
434- } ) ;
435-
436- it ( 'rejects an Object type with a field function that returns incorrect type' , ( ) => {
437- const objType = new GraphQLObjectType ( {
438- name : 'SomeObject' ,
439- // @ts -expect-error (Wrong type of return)
440- fields ( ) {
441- return [ { field : ScalarType } ] ;
442- } ,
443- } ) ;
444- expect ( ( ) => objType . getFields ( ) ) . to . throw ( ) ;
445- } ) ;
446-
447- it ( 'rejects an Object type with incorrectly named field args' , ( ) => {
448- const objType = new GraphQLObjectType ( {
449- name : 'SomeObject' ,
450- fields : {
451- badField : {
452- type : ScalarType ,
453- args : {
454- 'bad-name' : { type : ScalarType } ,
455- } ,
456- } ,
457- } ,
458- } ) ;
459- expect ( ( ) => objType . getFields ( ) ) . to . throw (
460- 'Names must only contain [_a-zA-Z0-9] but "bad-name" does not.' ,
461- ) ;
462- } ) ;
463417} ) ;
464418
465419describe ( 'Type System: Interfaces' , ( ) => {
@@ -563,12 +517,6 @@ describe('Type System: Interfaces', () => {
563517 } ) ;
564518 expect ( implementing . getInterfaces ( ) ) . to . deep . equal ( [ InterfaceType ] ) ;
565519 } ) ;
566-
567- it ( 'rejects an Interface type with invalid name' , ( ) => {
568- expect (
569- ( ) => new GraphQLInterfaceType ( { name : 'bad-name' , fields : { } } ) ,
570- ) . to . throw ( 'Names must only contain [_a-zA-Z0-9] but "bad-name" does not.' ) ;
571- } ) ;
572520} ) ;
573521
574522describe ( 'Type System: Unions' , ( ) => {
@@ -635,12 +583,6 @@ describe('Type System: Unions', () => {
635583 } ) ;
636584 expect ( unionType . getTypes ( ) ) . to . deep . equal ( [ ] ) ;
637585 } ) ;
638-
639- it ( 'rejects an Union type with invalid name' , ( ) => {
640- expect (
641- ( ) => new GraphQLUnionType ( { name : 'bad-name' , types : [ ] } ) ,
642- ) . to . throw ( 'Names must only contain [_a-zA-Z0-9] but "bad-name" does not.' ) ;
643- } ) ;
644586} ) ;
645587
646588describe ( 'Type System: Enums' , ( ) => {
@@ -786,24 +728,6 @@ describe('Type System: Enums', () => {
786728 expect ( enumType . getValue ( 'FOO' ) ) . has . property ( 'value' , 10 ) ;
787729 expect ( enumType . getValue ( 'BAR' ) ) . has . property ( 'value' , 20 ) ;
788730 } ) ;
789-
790- it ( 'rejects an Enum type with invalid name' , ( ) => {
791- expect (
792- ( ) => new GraphQLEnumType ( { name : 'bad-name' , values : { } } ) ,
793- ) . to . throw ( 'Names must only contain [_a-zA-Z0-9] but "bad-name" does not.' ) ;
794- } ) ;
795-
796- it ( 'rejects an Enum type with incorrectly named values' , ( ) => {
797- expect (
798- ( ) =>
799- new GraphQLEnumType ( {
800- name : 'SomeEnum' ,
801- values : {
802- 'bad-name' : { } ,
803- } ,
804- } ) ,
805- ) . to . throw ( 'Names must only contain [_a-zA-Z0-9] but "bad-name" does not.' ) ;
806- } ) ;
807731} ) ;
808732
809733describe ( 'Type System: Input Objects' , ( ) => {
@@ -887,26 +811,6 @@ describe('Type System: Input Objects', () => {
887811 astNode : undefined ,
888812 } ) ;
889813 } ) ;
890-
891- it ( 'rejects an Input Object type with invalid name' , ( ) => {
892- expect (
893- ( ) => new GraphQLInputObjectType ( { name : 'bad-name' , fields : { } } ) ,
894- ) . to . throw (
895- 'Names must only contain [_a-zA-Z0-9] but "bad-name" does not.' ,
896- ) ;
897- } ) ;
898-
899- it ( 'rejects an Input Object type with incorrectly named fields' , ( ) => {
900- const inputObjType = new GraphQLInputObjectType ( {
901- name : 'SomeInputObject' ,
902- fields : {
903- 'bad-name' : { type : ScalarType } ,
904- } ,
905- } ) ;
906- expect ( ( ) => inputObjType . getFields ( ) ) . to . throw (
907- 'Names must only contain [_a-zA-Z0-9] but "bad-name" does not.' ,
908- ) ;
909- } ) ;
910814 } ) ;
911815
912816 it ( 'Deprecation reason is preserved on fields' , ( ) => {
0 commit comments