chore: Merge branch 'v2-compat'

This commit is contained in:
Evan You
2021-04-28 12:30:57 -04:00
93 changed files with 5386 additions and 346 deletions

View File

@@ -481,4 +481,7 @@ describe('api: createApp', () => {
app.mount(root)
expect(serializeInner(root)).toBe('hello')
})
// config.compilerOptions is tested in packages/vue since it is only
// supported in the full build.
})

View File

@@ -6,7 +6,7 @@ import {
createApp,
shallowReadonly
} from '@vue/runtime-test'
import { ComponentInternalInstance } from '../src/component'
import { ComponentInternalInstance, ComponentOptions } from '../src/component'
describe('component: proxy', () => {
test('data', () => {
@@ -93,7 +93,7 @@ describe('component: proxy', () => {
expect(instanceProxy.$root).toBe(instance!.root.proxy)
expect(instanceProxy.$emit).toBe(instance!.emit)
expect(instanceProxy.$el).toBe(instance!.vnode.el)
expect(instanceProxy.$options).toBe(instance!.type)
expect(instanceProxy.$options).toBe(instance!.type as ComponentOptions)
expect(() => (instanceProxy.$data = {})).toThrow(TypeError)
expect(`Attempting to mutate public property "$data"`).toHaveBeenWarned()

View File

@@ -82,7 +82,7 @@ describe('component: slots', () => {
expect(slots.default()).toMatchObject([normalizeVNode(h('span'))])
})
test('updateSlots: instance.slots should be update correctly (when slotType is number)', async () => {
test('updateSlots: instance.slots should be updated correctly (when slotType is number)', async () => {
const flag1 = ref(true)
let instance: any
@@ -124,7 +124,7 @@ describe('component: slots', () => {
expect(instance.slots).toHaveProperty('two')
})
test('updateSlots: instance.slots should be update correctly (when slotType is null)', async () => {
test('updateSlots: instance.slots should be updated correctly (when slotType is null)', async () => {
const flag1 = ref(true)
let instance: any