Would be great if the type of prop could be derived from the component (mount(Component)) instead of explicitly defining it through the generic (mount<Props>). Vue test utils also managed to do this: https://github.com/vuejs/test-utils/blob/main/test-dts/mount.d-test.ts#L60.
<script lang="ts" setup>
defineProps<{ title: string }>();
</script>
<template>
<button>{{ title }}</button>
</template>
test('should not work', async ({ mount }) => {
await mount(Button, { props: {} }) // Should throw a type error because title is a required prop
})
Would be great if the type of prop could be derived from the component (
mount(Component)) instead of explicitly defining it through the generic (mount<Props>). Vue test utils also managed to do this: https://github.com/vuejs/test-utils/blob/main/test-dts/mount.d-test.ts#L60.