15 lines
366 B
TypeScript
15 lines
366 B
TypeScript
import { mount } from '@vue/test-utils';
|
|
import { defineComponent, Component } from 'vue'
|
|
|
|
export async function withSetup<T>(composable: () => T): Promise<T> {
|
|
return new Promise((resolve) => {
|
|
mount(defineComponent({
|
|
setup() {
|
|
resolve(composable());
|
|
// suppress missing template warning
|
|
return () => {}
|
|
}
|
|
}));
|
|
});
|
|
}
|