Skip to content

Commit ca71c0d

Browse files
committed
feat(compiler): Add test for get raw binding attr
1 parent 7388789 commit ca71c0d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: test/unit/modules/compiler/compiler-options.spec.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ describe('compile options', () => {
131131
expect(compiled.errors.length).toBe(1)
132132
expect(compiled.errors[0].start).toBe(0)
133133
expect(compiled.errors[0].end).toBeUndefined()
134-
expect(compiled.errors[0].msg).toContain('root element')
135134

136135
compiled = compile('<div v-if="a----">{{ b++++ }}</div>', { outputSourceRange: true })
137136
expect(compiled.errors.length).toBe(2)
@@ -140,4 +139,11 @@ describe('compile options', () => {
140139
expect(compiled.errors[1].start).toBe(18)
141140
expect(compiled.errors[1].end).toBe(29)
142141
})
142+
143+
it('should collect source range for binding keys', () => {
144+
const compiled = compile('<div><slot v-bind:key="key" /></div>', { outputSourceRange: true })
145+
expect(compiled.errors.length).toBe(1)
146+
expect(compiled.errors[0].start).toBe(11)
147+
expect(compiled.errors[0].end).toBe(27)
148+
})
143149
})

0 commit comments

Comments
 (0)