From: Eduardo San Martin Morote Date: Fri, 24 Apr 2020 16:42:00 +0000 (+0200) Subject: test: fix failing tests X-Git-Tag: v4.0.0-alpha.8~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1873f4f99a6a13ae0e18bc0c5700fe40e2215de6;p=thirdparty%2Fvuejs%2Frouter.git test: fix failing tests --- diff --git a/__tests__/mount.ts b/__tests__/mount.ts index ce4061d1..46091bc2 100644 --- a/__tests__/mount.ts +++ b/__tests__/mount.ts @@ -3,16 +3,15 @@ import { createApp, defineComponent, h, - ref, ComponentPublicInstance, reactive, nextTick, ComponentObjectPropsOptions, ComputedRef, computed, - markRaw, App, VNode, + shallowRef, } from 'vue' import { compile } from '@vue/compiler-dom' import * as runtimeDom from '@vue/runtime-dom' @@ -81,7 +80,7 @@ export function mount( const Wrapper = defineComponent({ setup(_props, { emit }) { - const componentInstanceRef = ref() + const componentInstanceRef = shallowRef() return () => { return h( @@ -158,10 +157,10 @@ export function createMockedRoute(initialValue: RouteLocationNormalizedLoose) { > } - const routeRef = ref(markRaw(initialValue)) + const routeRef = shallowRef(initialValue) function set(newRoute: RouteLocationNormalizedLoose) { - routeRef.value = markRaw(newRoute) + routeRef.value = newRoute return nextTick() } diff --git a/__tests__/urlEncoding.spec.ts b/__tests__/urlEncoding.spec.ts index abf1bccd..3e4ca5e5 100644 --- a/__tests__/urlEncoding.spec.ts +++ b/__tests__/urlEncoding.spec.ts @@ -4,7 +4,7 @@ import { RouteRecordRaw } from '../src/types' import { createMemoryHistory } from '../src' import * as encoding from '../src/encoding' -jest.mock('../src/utils/encoding') +jest.mock('../src/encoding') const routes: RouteRecordRaw[] = [ { path: '/', name: 'home', component: components.Home }, diff --git a/src/install.ts b/src/install.ts index d95df979..86d6b6ef 100644 --- a/src/install.ts +++ b/src/install.ts @@ -1,4 +1,4 @@ -import { App, ComputedRef, reactive } from 'vue' +import { App, ComputedRef, reactive, computed } from 'vue' import { Router } from './router' import { RouterLink } from './RouterLink' import { RouterView } from './RouterView'