diff --git a/package.json b/package.json index c039f3029..8b5dde996 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "unplugin-vue-components": "0.22.8", "vite": "3.1.8", "vitepress": "0.22.4", - "vitest": "0.22.1", + "vitest": "0.24.3", "vue": "3.2.41", "vue-class-component": "8.0.0-rc.1", "vue-router": "4.1.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c0a8f0956..4cd70edc7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,7 +34,7 @@ specifiers: unplugin-vue-components: 0.22.8 vite: 3.1.8 vitepress: 0.22.4 - vitest: 0.22.1 + vitest: 0.24.3 vue: 3.2.41 vue-class-component: 8.0.0-rc.1 vue-router: 4.1.5 @@ -75,7 +75,7 @@ devDependencies: unplugin-vue-components: 0.22.8_vue@3.2.41 vite: 3.1.8 vitepress: 0.22.4 - vitest: 0.22.1_jsdom@20.0.1 + vitest: 0.24.3_jsdom@20.0.1 vue: 3.2.41 vue-class-component: 8.0.0-rc.1_vue@3.2.41 vue-router: 4.1.5_vue@3.2.41 @@ -3468,6 +3468,12 @@ packages: acorn: 8.8.0 dev: true + /strip-literal/0.4.2: + resolution: {integrity: sha512-pv48ybn4iE1O9RLgCAN0iU4Xv7RlBTiit6DKmMiErbs9x1wH6vXBs45tWc0H5wUIF6TLTrKweqkmYF/iraQKNw==} + dependencies: + acorn: 8.8.0 + dev: true + /supports-color/5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -3517,11 +3523,20 @@ packages: engines: {node: '>=16.0.0'} dev: true + /tinybench/2.3.1: + resolution: {integrity: sha512-hGYWYBMPr7p4g5IarQE7XhlyWveh1EKhy4wUBS1LrHXCKYgvz+4/jCqgmJqZxxldesn05vccrtME2RLLZNW7iA==} + dev: true + /tinypool/0.2.4: resolution: {integrity: sha512-Vs3rhkUH6Qq1t5bqtb816oT+HeJTXfwt2cbPH17sWHIYKTotQIFPk3tf2fgqRrVyMDVOc1EnPgzIxfIulXVzwQ==} engines: {node: '>=14.0.0'} dev: true + /tinypool/0.3.0: + resolution: {integrity: sha512-NX5KeqHOBZU6Bc0xj9Vr5Szbb1j8tUHIeD18s41aDJaPeC5QTdEhK0SpdpUrZlj2nv5cctNcSjaKNanXlfcVEQ==} + engines: {node: '>=14.0.0'} + dev: true + /tinyspy/1.0.2: resolution: {integrity: sha512-bSGlgwLBYf7PnUsQ6WOc6SJ3pGOcd+d8AA6EUnLDDM0kWEstC1JIlSZA3UNliDXhd9ABoS7hiRBDCu+XP/sf1Q==} engines: {node: '>=14.0.0'} @@ -3753,8 +3768,8 @@ packages: - stylus dev: true - /vitest/0.22.1_jsdom@20.0.1: - resolution: {integrity: sha512-+x28YTnSLth4KbXg7MCzoDAzPJlJex7YgiZbUh6YLp0/4PqVZ7q7/zyfdL0OaPtKTpNiQFPpMC8Y2MSzk8F7dw==} + /vitest/0.23.0_jsdom@20.0.1: + resolution: {integrity: sha512-I3ctlfiXYprA2tID1qP+m6pmgmKx3HYfRe66MetGOHKCHLY7hz74ihiwIEtN7LReJgF3U5cM735iYPkn/Go1iQ==} engines: {node: '>=v14.16.0'} hasBin: true peerDependencies: @@ -3782,6 +3797,8 @@ packages: debug: 4.3.4 jsdom: 20.0.1 local-pkg: 0.4.2 + strip-literal: 0.4.0 + tinybench: 2.1.4 tinypool: 0.2.4 tinyspy: 1.0.2 vite: 3.1.8 @@ -3793,8 +3810,8 @@ packages: - terser dev: true - /vitest/0.23.0_jsdom@20.0.1: - resolution: {integrity: sha512-I3ctlfiXYprA2tID1qP+m6pmgmKx3HYfRe66MetGOHKCHLY7hz74ihiwIEtN7LReJgF3U5cM735iYPkn/Go1iQ==} + /vitest/0.24.3_jsdom@20.0.1: + resolution: {integrity: sha512-aM0auuPPgMSstWvr851hB74g/LKaKBzSxcG3da7ejfZbx08Y21JpZmbmDYrMTCGhVZKqTGwzcnLMwyfz2WzkhQ==} engines: {node: '>=v14.16.0'} hasBin: true peerDependencies: @@ -3822,9 +3839,9 @@ packages: debug: 4.3.4 jsdom: 20.0.1 local-pkg: 0.4.2 - strip-literal: 0.4.0 - tinybench: 2.1.4 - tinypool: 0.2.4 + strip-literal: 0.4.2 + tinybench: 2.3.1 + tinypool: 0.3.0 tinyspy: 1.0.2 vite: 3.1.8 transitivePeerDependencies: diff --git a/tests/features/compat.spec.ts b/tests/features/compat.spec.ts index 34c337885..3fb175088 100644 --- a/tests/features/compat.spec.ts +++ b/tests/features/compat.spec.ts @@ -3,7 +3,7 @@ import * as mockVue from '@vue/compat' import { mount } from '../../src' vi.mock('vue', () => mockVue) -const { configureCompat, extend, defineComponent, h } = mockVue +const { configureCompat, defineComponent, h } = mockVue // @ts-expect-error @vue/compat does not expose default export in types const Vue = mockVue.default @@ -46,7 +46,7 @@ describe('@vue/compat build', () => { it('finds components declared with legacy Vue.extend', () => { configureCompat({ MODE: 3, GLOBAL_EXTEND: 'suppress-warning' }) - const LegacyComponent = extend({ + const LegacyComponent = Vue.extend({ template: '
LEGACY
' }) @@ -97,7 +97,7 @@ describe('@vue/compat build', () => { COMPONENT_FUNCTIONAL: 'suppress-warning' }) - const Component = extend({ + const Component = Vue.extend({ functional: true, render: () => h('div', 'test') }) @@ -112,7 +112,7 @@ describe('@vue/compat build', () => { GLOBAL_EXTEND: 'suppress-warning' }) - const Foo = extend({ + const Foo = Vue.extend({ name: 'Foo', template: '
original
' }) @@ -147,7 +147,7 @@ describe('@vue/compat build', () => { template: '
original
' } - const FooStub = extend({ template: '
stubbed
' }) + const FooStub = Vue.extend({ template: '
stubbed
' }) const Component = { components: { NamedAsNotFoo: Foo }, @@ -172,7 +172,7 @@ describe('@vue/compat build', () => { GLOBAL_MOUNT: 'suppress-warning' }) - const Component = extend({ + const Component = Vue.extend({ data() { return { foo: 'bar' } }, diff --git a/vitest.config.ts b/vitest.config.ts index 7aa625d69..855b47114 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -35,6 +35,9 @@ export default defineConfig({ }, resolve: { extensions: ['.vue', '.js', '.json', '.jsx', '.ts', '.tsx', '.node'], - dedupe: ['vue', '@vue/compat'] + dedupe: ['vue', '@vue/compat'], + alias: { + '@vue/compat': '@vue/compat/dist/vue.esm-bundler.js' + } } })