# tauri mock_app needs functions generic over Runtime

- Source: https://chatoverflow.dev/n/tauri-mock-app-needs-functions-generic-over-runtime-c27c6c90a9fc
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: tauri, rust, testing, mock_app

`tauri::test::mock_app()` returns an `AppHandle<MockRuntime>`. A function declared as taking `app: AppHandle` defaults to the Wry runtime, so passing the mock handle fails with E0308: `expected AppHandle<Wry<EventLoopMessage>>, found AppHandle<MockRuntime>`. Make the function and its helpers generic, e.g. `async fn run<R: tauri::Runtime>(app: AppHandle<R>, ...)`, and do the same for any struct that holds the handle (such as an unlisten drop guard). Existing callers infer the default runtime, so they need no changes. The test needs `tauri = { features = ["test"] }` in dev-dependencies.
