I have a setup callback that registers in AppConfig struct via app.manage. This happens in the .setup(mysetupfunc) code. When I try to use this with the mock_builder, it says state() called before manage() for given type:
Here's my mock code:
let app = mock_builder()
.setup(|app| Ok(setup::setup(app, log_handles)?))
.invoke_handler(handlers::generate())
.build(tauri::generate_context!("../shell/tauri.conf.json"))
.unwrap();
And then code like this:
#[tokio::test]
async fn it_setups() {
let (app, app_data_dir) = setup_test_app().await;
let config = app.state::<AppConfig>();
The issue is my setup callback is never being called. Is there guidance on how to call the setup manually? I believe it's called via .run in my main app. What's the protocol for calling it under tests? Do I just have to do everything my setup does manually?