async function mountTestComponent({ testPath, componentName, data = {} }) {
  // Validate inputs
  if (!testPath || !componentName) throw new Error('Required parameters missing: "testPath" and "componentName" must be provided')

  // Setup domino DOM environment
  const window = createWindow('<!DOCTYPE html><html><body></body></html>')
  const document = window.document
  const mountPoint = document.createElement('div')

  // Setup global context
  const globalContext = { window, document, fetch: globalThis.fetch }
  Object.assign(global, globalContext)
  document.body.appendChild(mountPoint)

  try {
    // Load and parse component
    const dhtmlPath = join(testPath, 'component.dhtml')
    const source = readFileSync(dhtmlPath, 'utf-8')
    const components = parseComponents(source)

    const App = components.find(comp => comp.name === componentName)
    if (!App) throw new Error(`Component "${componentName}" not found in "${dhtmlPath}"`)

    // Mount component
    const { default: createApp } = await import('../src/browser/nue.js')
    const deps = components.filter(comp => comp !== App)
    const app = createApp(App, data, deps)
    app.mount(mountPoint)

    return {
      app,
      cleanup: () => {
        // Clean up globals
        Object.keys(globalContext).forEach(key => delete global[key])
        mountPoint.remove()
      },
    }
  } catch (error) {
    // Clean up on error
    Object.keys(globalContext).forEach(key => delete global[key])
    throw error
  }
}
Mounts a component from a test directory
@param {Object} options - Mount options
@param {string} options.testPath - The path to the test directory
@param {string} options.componentName - Name of the specific component to mount
@param {Object} [options.data={}] - Data to initialize the component with