// Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ import renderComponent, { type ExtendedRenderResult, } from './renderComponent.ts' const components = new Set() afterEach(() => { components.forEach((component) => { component.unmount() }) }) export const mounted = (fn: () => T) => { let result: T const component = renderComponent({ template: '
', setup() { result = fn() }, }) components.add(component) // @ts-expect-error doesn't know that setup is called in sync return result }