Describe the bug
When mounting a component that uses useRoute() or useRouter() with vue-test-utils and a vue-i18n-router, the useRoute and useRouter composables do not return any values. Instead the following error will be printed:
[Vue warn]: injection "Symbol(route location)" not found.
at <HelloWorld ref="VTU_COMPONENT" >
at <VTUROOT>
When using a vue-router instead of the vue-i18n-router everything is working as expected.
Reproduction
https://stackblitz.com/edit/vitejs-vite-vckr8m?file=tests%2FSample.spec.js
System Info
System:
OS: Linux 5.0 undefined
CPU: (2) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 18.18.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.15.3 - /usr/local/bin/pnpm
Used Package Manager
npm
Additional context
No response
Validations
Describe the bug
When mounting a component that uses
useRoute()oruseRouter()withvue-test-utilsand avue-i18n-router, theuseRouteanduseRoutercomposables do not return any values. Instead the following error will be printed:When using a
vue-routerinstead of thevue-i18n-routereverything is working as expected.Reproduction
https://stackblitz.com/edit/vitejs-vite-vckr8m?file=tests%2FSample.spec.js
System Info
System: OS: Linux 5.0 undefined CPU: (2) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 18.18.0 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.2.3 - /usr/local/bin/npm pnpm: 8.15.3 - /usr/local/bin/pnpmUsed Package Manager
npm
Additional context
No response
Validations