Replies: 2 comments 1 reply
-
I'm not familiar with tauri and does this mean you want to test js code living in their webview? It does sound technically possible with Vitest's architecture. It won't work like jsdom/happy-dom integration and it'll probably require either cloudflare's vitest pool like approach https://github.com/cloudflare/workers-sdk/tree/main/packages/vitest-pool-workers or maybe on browser mode with webdriverio (which I just found they are thinking about it webdriverio/webdriverio#13672) Either way this'll require quite a bit of knowledge on both sides. It looks like they suggests mocking right now https://v2.tauri.app/develop/tests/mocking/ and you should probably make a feature request on Tauri side first. |
Beta Was this translation helpful? Give feedback.
-
Hi @hi-ogawa, thank you very much for your reply. This all sounds very complex. Tauri has an own webdriver (pre alpha) as described here. The expample on the page looks like that you can use this one only for surface tests (end to end) instead of testing directly the JS functions. Is it possible with this technology also to test directly JS functions / methods, which will call the Rust functions? |
Beta Was this translation helpful? Give feedback.
-
Hello,
Is it somehow possible to use Vitest for Tauri integration tests? This means, I would like to test a TS / JS method that calls the Rust part of the Tauri app without mocking it.
I read that Vitest supports multiple environments like jsdom or happy-dom for instance. Is there also an environment for Tauri?
Or is there a workaround / hack, that I can run the tests directly in the Tauri app (maybe without parallelization of them). I know that this would not be a good design…
Best regards
Frank
Beta Was this translation helpful? Give feedback.
All reactions