Skip to content

Commit 33d7c68

Browse files
committed
chore: update to vitest v0.24.3
We were blocked by vitest-dev/vitest#1978 but thanks to @sheremet-va help (see vitest-dev/vitest#1978 (comment)) we now have a way to use the latest vitest releases. It turns out that we needed to: - alias `@vue/compat` to its ESM bundle - use `Vue.extend` instead of `extend` in the `compat.spec.ts` file, as `extend` is not a named export
1 parent f68ceee commit 33d7c68

File tree

4 files changed

+37
-17
lines changed

4 files changed

+37
-17
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"unplugin-vue-components": "0.22.8",
5656
"vite": "3.1.8",
5757
"vitepress": "0.22.4",
58-
"vitest": "0.22.1",
58+
"vitest": "0.24.3",
5959
"vue": "3.2.41",
6060
"vue-class-component": "8.0.0-rc.1",
6161
"vue-router": "4.1.5",

pnpm-lock.yaml

Lines changed: 26 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/features/compat.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as mockVue from '@vue/compat'
33
import { mount } from '../../src'
44

55
vi.mock('vue', () => mockVue)
6-
const { configureCompat, extend, defineComponent, h } = mockVue
6+
const { configureCompat, defineComponent, h } = mockVue
77
// @ts-expect-error @vue/compat does not expose default export in types
88
const Vue = mockVue.default
99

@@ -46,7 +46,7 @@ describe('@vue/compat build', () => {
4646
it('finds components declared with legacy Vue.extend', () => {
4747
configureCompat({ MODE: 3, GLOBAL_EXTEND: 'suppress-warning' })
4848

49-
const LegacyComponent = extend({
49+
const LegacyComponent = Vue.extend({
5050
template: '<div>LEGACY</div>'
5151
})
5252

@@ -97,7 +97,7 @@ describe('@vue/compat build', () => {
9797
COMPONENT_FUNCTIONAL: 'suppress-warning'
9898
})
9999

100-
const Component = extend({
100+
const Component = Vue.extend({
101101
functional: true,
102102
render: () => h('div', 'test')
103103
})
@@ -112,7 +112,7 @@ describe('@vue/compat build', () => {
112112
GLOBAL_EXTEND: 'suppress-warning'
113113
})
114114

115-
const Foo = extend({
115+
const Foo = Vue.extend({
116116
name: 'Foo',
117117
template: '<div>original</div>'
118118
})
@@ -147,7 +147,7 @@ describe('@vue/compat build', () => {
147147
template: '<div>original</div>'
148148
}
149149

150-
const FooStub = extend({ template: '<div>stubbed</div>' })
150+
const FooStub = Vue.extend({ template: '<div>stubbed</div>' })
151151

152152
const Component = {
153153
components: { NamedAsNotFoo: Foo },
@@ -172,7 +172,7 @@ describe('@vue/compat build', () => {
172172
GLOBAL_MOUNT: 'suppress-warning'
173173
})
174174

175-
const Component = extend({
175+
const Component = Vue.extend({
176176
data() {
177177
return { foo: 'bar' }
178178
},

vitest.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ export default defineConfig({
3535
},
3636
resolve: {
3737
extensions: ['.vue', '.js', '.json', '.jsx', '.ts', '.tsx', '.node'],
38-
dedupe: ['vue', '@vue/compat']
38+
dedupe: ['vue', '@vue/compat'],
39+
alias: {
40+
'@vue/compat': '@vue/compat/dist/vue.esm-bundler.js'
41+
}
3942
}
4043
})

0 commit comments

Comments
 (0)