We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1bc9066 commit 2484a06Copy full SHA for 2484a06
tests/valibot.spec.ts
@@ -214,4 +214,36 @@ describe('valibot', () => {
214
"
215
`);
216
});
217
+ it('with importFrom', async () => {
218
+ const schema = buildSchema(/* GraphQL */ `
219
+ input Say {
220
+ phrase: String!
221
+ }
222
+ `);
223
+ const result = await plugin(
224
+ schema,
225
+ [],
226
+ {
227
+ schema: 'valibot',
228
+ importFrom: './types',
229
+ },
230
+ {},
231
+ );
232
+ expect(result.prepend).toMatchInlineSnapshot(`
233
+ [
234
+ "import * as v from 'valibot'",
235
+ "import { Say } from './types'",
236
+ ]
237
238
+ expect(result.content).toMatchInlineSnapshot(`
239
+ "
240
+
241
+ export function SaySchema(): v.GenericSchema<Say> {
242
+ return v.object({
243
+ phrase: v.string()
244
+ })
245
246
247
248
+ });
249
})
0 commit comments