@@ -500,7 +500,7 @@ describe('myzod', () => {
500500 {
501501 schema : 'myzod' ,
502502 } ,
503- { }
503+ { } ,
504504 ) ;
505505 expect ( result . content ) . not . toContain ( 'export function UserSchema(): myzod.Type<User> {' ) ;
506506 } ) ;
@@ -518,19 +518,18 @@ describe('myzod', () => {
518518 schema : 'myzod' ,
519519 withInterfaceType : true ,
520520 } ,
521- { }
521+ { } ,
522522 ) ;
523523 const wantContains = [
524524 'export function BookSchema(): myzod.Type<Book> {' ,
525525 'title: myzod.string().optional().nullable()' ,
526526 ] ;
527- const wantNotContains = [ " __typename: myzod.literal('Book')" ] ;
528- for ( const wantContain of wantContains ) {
527+ const wantNotContains = [ ' __typename: myzod.literal(\ 'Book\')' ] ;
528+ for ( const wantContain of wantContains )
529529 expect ( result . content ) . toContain ( wantContain ) ;
530- }
531- for ( const wantNotContain of wantNotContains ) {
530+
531+ for ( const wantNotContain of wantNotContains )
532532 expect ( result . content ) . not . toContain ( wantNotContain ) ;
533- }
534533 } ) ;
535534
536535 it ( 'generate interface type contains interface type' , async ( ) => {
@@ -552,7 +551,7 @@ describe('myzod', () => {
552551 schema : 'myzod' ,
553552 withInterfaceType : true ,
554553 } ,
555- { }
554+ { } ,
556555 ) ;
557556 const wantContains = [
558557 'export function AuthorSchema(): myzod.Type<Author> {' ,
@@ -563,9 +562,8 @@ describe('myzod', () => {
563562 'author: AuthorSchema().optional().nullable(),' ,
564563 'title: myzod.string().optional().nullable()' ,
565564 ] ;
566- for ( const wantContain of wantContains ) {
565+ for ( const wantContain of wantContains )
567566 expect ( result . content ) . toContain ( wantContain ) ;
568- }
569567 } ) ;
570568 it ( 'generate object type contains interface type' , async ( ) => {
571569 const schema = buildSchema ( /* GraphQL */ `
@@ -599,7 +597,7 @@ describe('myzod', () => {
599597 withInterfaceType : true ,
600598 withObjectType : true ,
601599 } ,
602- { }
600+ { } ,
603601 ) ;
604602 const wantContains = [
605603 [
@@ -614,7 +612,7 @@ describe('myzod', () => {
614612 [
615613 'export function TextbookSchema(): myzod.Type<Textbook> {' ,
616614 'return myzod.object({' ,
617- " __typename: myzod.literal('Textbook').optional()," ,
615+ ' __typename: myzod.literal(\ 'Textbook\ ').optional(),' ,
618616 'title: myzod.string(),' ,
619617 'author: AuthorSchema(),' ,
620618 'courses: myzod.array(myzod.string())' ,
@@ -625,7 +623,7 @@ describe('myzod', () => {
625623 [
626624 'export function ColoringBookSchema(): myzod.Type<ColoringBook> {' ,
627625 'return myzod.object({' ,
628- " __typename: myzod.literal('ColoringBook').optional()," ,
626+ ' __typename: myzod.literal(\ 'ColoringBook\ ').optional(),' ,
629627 'title: myzod.string(),' ,
630628 'author: AuthorSchema(),' ,
631629 'colors: myzod.array(myzod.string())' ,
@@ -636,17 +634,16 @@ describe('myzod', () => {
636634 [
637635 'export function AuthorSchema(): myzod.Type<Author> {' ,
638636 'return myzod.object({' ,
639- " __typename: myzod.literal('Author').optional()" ,
637+ ' __typename: myzod.literal(\ 'Author\ ').optional()' ,
640638 'books: myzod.array(BookSchema()).optional().nullable()' ,
641639 'name: myzod.string().optional().nullable()' ,
642640 '})' ,
643641 '}' ,
644642 ] ,
645643 ] ;
646644 for ( const wantContain of wantContains ) {
647- for ( const wantContainLine of wantContain ) {
645+ for ( const wantContainLine of wantContain )
648646 expect ( result . content ) . toContain ( wantContainLine ) ;
649- }
650647 }
651648 } ) ;
652649 } ) ;
0 commit comments