wip: more compat tweaks

This commit is contained in:
Evan You
2021-04-22 14:59:54 -04:00
parent 98bc9a26e9
commit 7e0224aa8c
9 changed files with 86 additions and 14 deletions

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,9 @@ 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).__merged
)
expect(() => (instanceProxy.$data = {})).toThrow(TypeError)
expect(`Attempting to mutate public property "$data"`).toHaveBeenWarned()