|
|
@@ -1133,6 +1133,19 @@ const emit = defineEmits(['a', 'b'])
|
|
|
expect(content).toMatch(`emits: ["foo", "bar"]`)
|
|
|
})
|
|
|
|
|
|
+ // #5393
|
|
|
+ test('defineEmits w/ type (interface ts type)', () => {
|
|
|
+ const { content } = compile(`
|
|
|
+ <script setup lang="ts">
|
|
|
+ interface Emits { (e: 'foo'): void }
|
|
|
+ const emit: Emits = defineEmits(['foo'])
|
|
|
+ </script>
|
|
|
+ `)
|
|
|
+ assertCode(content)
|
|
|
+ expect(content).toMatch(`setup(__props, { expose, emit }) {`)
|
|
|
+ expect(content).toMatch(`emits: ['foo']`)
|
|
|
+ })
|
|
|
+
|
|
|
test('runtime Enum', () => {
|
|
|
const { content, bindings } = compile(
|
|
|
`<script setup lang="ts">
|