Skip to content

Commit 8448bca

Browse files
committed
fix(types): with latest test utils
1 parent 1a29afb commit 8448bca

File tree

2 files changed

+1441
-2401
lines changed

2 files changed

+1441
-2401
lines changed

src/injections.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,15 @@ export function injectRouterMock(router?: RouterMock) {
3737
config.global.components.RouterView = RouterView
3838
config.global.components.RouterLink = RouterLink
3939

40-
config.global.stubs.RouterLink = true
41-
config.global.stubs.RouterView = true
40+
// TODO: remove if https://github.com/vuejs/vue-test-utils-next/issues/1023
41+
// gets merged
42+
if (Array.isArray(config.global.stubs)) {
43+
config.global.stubs.push('RouterLink')
44+
config.global.stubs.push('RouterView')
45+
} else {
46+
config.global.stubs.RouterLink = true
47+
config.global.stubs.RouterView = true
48+
}
4249

4350
return { router, route }
4451
}

0 commit comments

Comments
 (0)