File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -238,6 +238,39 @@ describe('valibot', () => {
238
238
expect ( result . content ) . toMatchInlineSnapshot ( `
239
239
"
240
240
241
+ export function SaySchema(): v.GenericSchema<Say> {
242
+ return v.object({
243
+ phrase: v.string()
244
+ })
245
+ }
246
+ "
247
+ ` ) ;
248
+ } ) ;
249
+ it ( 'with importFrom & useTypeImports' , async ( ) => {
250
+ const schema = buildSchema ( /* GraphQL */ `
251
+ input Say {
252
+ phrase: String!
253
+ }
254
+ ` ) ;
255
+ const result = await plugin (
256
+ schema ,
257
+ [ ] ,
258
+ {
259
+ schema : 'valibot' ,
260
+ importFrom : './types' ,
261
+ useTypeImports : true ,
262
+ } ,
263
+ { } ,
264
+ ) ;
265
+ expect ( result . prepend ) . toMatchInlineSnapshot ( `
266
+ [
267
+ "import * as v from 'valibot'",
268
+ "import type { Say } from './types'",
269
+ ]
270
+ ` ) ;
271
+ expect ( result . content ) . toMatchInlineSnapshot ( `
272
+ "
273
+
241
274
export function SaySchema(): v.GenericSchema<Say> {
242
275
return v.object({
243
276
phrase: v.string()
You can’t perform that action at this time.
0 commit comments