]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
test: fix failing tests
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 24 Apr 2020 16:42:00 +0000 (18:42 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Fri, 24 Apr 2020 16:42:00 +0000 (18:42 +0200)
__tests__/mount.ts
__tests__/urlEncoding.spec.ts
src/install.ts

index ce4061d1fd3be390f5b5f2afd6d3b061bfb29898..46091bc2caee2e3ac632938d8dd0b5e927c1b7ce 100644 (file)
@@ -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<ComponentPublicInstance>()
+        const componentInstanceRef = shallowRef<ComponentPublicInstance>()
 
         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()
   }
 
index abf1bccdb65f48dac41356a3473fefc147d11528..3e4ca5e5c00a5405bae4bc82640c8c382da37bae 100644 (file)
@@ -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 },
index d95df979b1fc830863843f00c29d5eacba46547e..86d6b6ef09927caaf307cd85b6cbf30cb767d162 100644 (file)
@@ -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'