Skip to content

Commit 8ef603b

Browse files
committed
test <template> key warning, fix coverage
1 parent 51aa3e5 commit 8ef603b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/unit/modules/compiler/parser.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ describe('parser', () => {
120120
expect('Cannot use v-for on stateful component root element').toHaveBeenWarned()
121121
})
122122

123+
it('warn <template> key', () => {
124+
parse('<div><template v-for="i in 10" :key="i"></template></div>', baseOptions)
125+
expect('<template> cannot be keyed').toHaveBeenWarned()
126+
})
127+
123128
it('v-pre directive', () => {
124129
const ast = parse('<div v-pre id="message1"><p>{{msg}}</p></div>', baseOptions)
125130
expect(ast.pre).toBe(true)

0 commit comments

Comments
 (0)