I am facing a challenge with unit testing the routing behavior of a vue component using jest. Specifically, when navigating away from the component, the 'beforeRouteLeave' guard in Vue-router is not triggering during testing, even though it works fine in production.
My testing setup includes jest as the framework and vue-test-utils to mount the component and create a local Vue instance with vue-router.
To see an example of this issue, you can check out the test located in 'src/components/HelloWorld.spec'. Here's the link: https://codesandbox.io/s/72536ojvp6?module=%2Fsrc%2Fcomponents%2FHelloWorld.spec.js
I'm puzzled as to why the router hook is not being called during testing. Any insights on how I can resolve this would be greatly appreciated. Thank you!