Skip to content

Commit 93342d7

Browse files
committed
fix coverage
1 parent 579ff4d commit 93342d7

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

test/unit/modules/compiler/compiler-options.spec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,15 @@ describe('compile options', () => {
114114
expect(vm.$el.innerHTML).toBe('<input type="text">')
115115
expect(vm.$children[0].valid).toBe(true)
116116
})
117+
118+
it('should collect errors', () => {
119+
let compiled = compile('hello')
120+
expect(compiled.errors.length).toBe(1)
121+
expect(compiled.errors[0]).toContain('should contain exactly one root element')
122+
123+
compiled = compile('<div v-if="a----">{{ b++++ }}</div>')
124+
expect(compiled.errors.length).toBe(2)
125+
expect(compiled.errors[0]).toContain('invalid expression: v-if="a----"')
126+
expect(compiled.errors[1]).toContain('invalid expression: {{ b++++ }}')
127+
})
117128
})

test/unit/modules/vdom/patch/element.spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ describe('element', () => {
2222
expect(`Unknown custom element: <unknown>`).toHaveBeenWarned()
2323
})
2424

25+
it('should warn unknown element with hyphen', () => {
26+
const vnode = new VNode('unknown-foo')
27+
patch(null, vnode)
28+
expect(`Unknown custom element: <unknown-foo>`).toHaveBeenWarned()
29+
})
30+
2531
it('should create an elements which having text content', () => {
2632
const vnode = new VNode('div', {}, [createTextVNode('hello world')])
2733
const elm = patch(null, vnode)

0 commit comments

Comments
 (0)