File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -466,7 +466,39 @@ describe('valibot', () => {
466
466
"
467
467
` )
468
468
} )
469
- it . todo ( 'with typesSuffix' )
469
+ it ( 'with typesSuffix' , async ( ) => {
470
+ const schema = buildSchema ( /* GraphQL */ `
471
+ input Say {
472
+ phrase: String!
473
+ }
474
+ ` ) ;
475
+ const result = await plugin (
476
+ schema ,
477
+ [ ] ,
478
+ {
479
+ schema : 'valibot' ,
480
+ typesSuffix : 'I' ,
481
+ importFrom : './types' ,
482
+ } ,
483
+ { } ,
484
+ ) ;
485
+ expect ( result . prepend ) . toMatchInlineSnapshot ( `
486
+ [
487
+ "import * as v from 'valibot'",
488
+ "import { SayI } from './types'",
489
+ ]
490
+ ` )
491
+ expect ( result . content ) . toMatchInlineSnapshot ( `
492
+ "
493
+
494
+ export function SayISchema(): v.GenericSchema<SayI> {
495
+ return v.object({
496
+ phrase: v.string()
497
+ })
498
+ }
499
+ "
500
+ ` )
501
+ } )
470
502
it . todo ( 'with default input values' )
471
503
describe ( 'issues #19' , ( ) => {
472
504
it ( 'string field' , async ( ) => {
You can’t perform that action at this time.
0 commit comments