Skip to content

Commit 4646de0

Browse files
committed
test: support typeSuffix
1 parent e4c7b4d commit 4646de0

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

tests/valibot.spec.ts

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,39 @@ describe('valibot', () => {
466466
"
467467
`)
468468
})
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+
})
470502
it.todo('with default input values')
471503
describe('issues #19', () => {
472504
it('string field', async () => {

0 commit comments

Comments
 (0)