1
+ import { beforeEach , describe , expect , it , vi } from 'vitest'
1
2
import { defineComponent , ComponentPublicInstance , h , inject } from 'vue'
2
3
import type { App } from 'vue'
3
4
import { config , mount } from '../src'
@@ -18,7 +19,7 @@ describe('config', () => {
18
19
renderStubDefaultSlot : false
19
20
}
20
21
21
- jest . clearAllMocks ( )
22
+ vi . clearAllMocks ( )
22
23
} )
23
24
24
25
describe ( 'config merger' , ( ) => {
@@ -55,8 +56,8 @@ describe('config', () => {
55
56
describe ( 'config integrity' , ( ) => {
56
57
it ( 'should not leak config when plugins overwrite globalProperties' , async ( ) => {
57
58
// test with a function because it's not an "easy to clone" primitive type
58
- const globalRouterMock = { push : jest . fn ( ) }
59
- const pluginRouterMock = { push : jest . fn ( ) }
59
+ const globalRouterMock = { push : vi . fn ( ) }
60
+ const pluginRouterMock = { push : vi . fn ( ) }
60
61
const Component = defineComponent ( { template : '<div />' } )
61
62
62
63
class Plugin {
@@ -121,14 +122,14 @@ describe('config', () => {
121
122
expect ( comp . find ( '#default-slot' ) . exists ( ) ) . toBe ( true )
122
123
123
124
// @ts -expect-error
124
- let comp = mount ( Component , {
125
+ let comp2 = mount ( Component , {
125
126
shallow : true ,
126
127
global : {
127
128
renderStubDefaultSlot : 0
128
129
}
129
130
} )
130
131
131
- expect ( comp . find ( '#default-slot' ) . exists ( ) ) . toBe ( false )
132
+ expect ( comp2 . find ( '#default-slot' ) . exists ( ) ) . toBe ( false )
132
133
} )
133
134
} )
134
135
@@ -256,7 +257,7 @@ describe('config', () => {
256
257
} )
257
258
258
259
describe ( 'mixins' , ( ) => {
259
- const createdHook = jest . fn ( )
260
+ const createdHook = vi . fn ( )
260
261
const mixin = {
261
262
created ( ) {
262
263
createdHook ( )
@@ -278,7 +279,7 @@ describe('config', () => {
278
279
279
280
it ( 'concat with locally defined mixins' , ( ) => {
280
281
config . global . mixins = [ mixin ]
281
- const localHook = jest . fn ( )
282
+ const localHook = vi . fn ( )
282
283
const localMixin = {
283
284
created ( ) {
284
285
localHook ( this . $options ! . name )
0 commit comments