import { mount } from '@vue/test-utils'; import { defineComponent } from 'vue' export function withSetup(composable: () => T): T { let result: T; mount(defineComponent({ setup() { result = composable(); // suppress missing template warning return () => {} } })); // return the result and the app instance // for testing provide/unmount return result; }