mirror of
https://gitee.com/vuejs/vue.git
synced 2024-12-05 05:27:59 +08:00
test computed property conflict warnings
This commit is contained in:
parent
dc4f3aaf11
commit
841fe6028a
@ -167,4 +167,27 @@ describe('Options computed', () => {
|
||||
expect(vm.$el.textContent).toBe('3 4')
|
||||
}).then(done)
|
||||
})
|
||||
|
||||
it('warn conflict with data', () => {
|
||||
new Vue({
|
||||
data: {
|
||||
a: 1
|
||||
},
|
||||
computed: {
|
||||
a: () => 2
|
||||
}
|
||||
})
|
||||
expect(`computed property "a" is already defined in data`).toHaveBeenWarned()
|
||||
})
|
||||
|
||||
it('warn conflict with props', () => {
|
||||
new Vue({
|
||||
props: ['a'],
|
||||
propsData: { a: 1 },
|
||||
computed: {
|
||||
a: () => 2
|
||||
}
|
||||
})
|
||||
expect(`computed property "a" is already defined as a prop`).toHaveBeenWarned()
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user