Skip to content

Commit ebb4ab0

Browse files
committed
test: search types in other script block
1 parent 7683aa7 commit ebb4ab0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/setup.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ describe('transform typescript script setup', () => {
4848
})
4949
</script>"
5050
`)
51+
expect(
52+
await fixture([
53+
`<script lang="ts">interface PropsData { msg?: string, count: number }</script>`,
54+
`<script setup lang="ts">const { msg = 'hello' } = defineProps<PropsData>()</script>`,
55+
].join('\n')),
56+
).toMatchInlineSnapshot(`
57+
"<script setup>
58+
const { msg = 'hello' } = defineProps({
59+
msg: { type: String, required: false },
60+
count: { type: Number, required: true }
61+
})
62+
</script>"
63+
`)
5164
})
5265

5366
it('strips generic from script setup blocks', async () => {

0 commit comments

Comments
 (0)