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 @@ -433,7 +433,39 @@ describe('valibot', () => {
433
433
"
434
434
` )
435
435
} ) ;
436
- it . todo ( 'with typesPrefix' )
436
+ it ( 'with typesPrefix' , async ( ) => {
437
+ const schema = buildSchema ( /* GraphQL */ `
438
+ input Say {
439
+ phrase: String!
440
+ }
441
+ ` ) ;
442
+ const result = await plugin (
443
+ schema ,
444
+ [ ] ,
445
+ {
446
+ schema : 'valibot' ,
447
+ typesPrefix : 'I' ,
448
+ importFrom : './types' ,
449
+ } ,
450
+ { } ,
451
+ ) ;
452
+ expect ( result . prepend ) . toMatchInlineSnapshot ( `
453
+ [
454
+ "import * as v from 'valibot'",
455
+ "import { ISay } from './types'",
456
+ ]
457
+ ` )
458
+ expect ( result . content ) . toMatchInlineSnapshot ( `
459
+ "
460
+
461
+ export function ISaySchema(): v.GenericSchema<ISay> {
462
+ return v.object({
463
+ phrase: v.string()
464
+ })
465
+ }
466
+ "
467
+ ` )
468
+ } )
437
469
it . todo ( 'with typesSuffix' )
438
470
it . todo ( 'with default input values' )
439
471
describe ( 'issues #19' , ( ) => {
You can’t perform that action at this time.
0 commit comments