forked from vuejs/vue
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrender-proxy.spec.js
More file actions
32 lines (29 loc) · 899 Bytes
/
render-proxy.spec.js
File metadata and controls
32 lines (29 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import Vue from 'vue'
if (typeof Proxy !== 'undefined') {
describe('render proxy', () => {
it('should warn missing property in render fns with `with`', () => {
new Vue({
template: `<div>{{ a }}</div>`
}).$mount()
expect(`Property or method "a" is not defined`).toHaveBeenWarned()
})
it('should warn missing property in render fns without `with`', () => {
const render = function (h) {
return h('div', [this.a])
}
render._withStripped = true
new Vue({
render
}).$mount()
expect(`Property or method "a" is not defined`).toHaveBeenWarned()
})
it('should not warn for hand-written render functions', () => {
new Vue({
render (h) {
return h('div', [this.a])
}
}).$mount()
expect(`Property or method "a" is not defined`).not.toHaveBeenWarned()
})
})
}