From ca71c0debef4feb332779f7225060fde81774420 Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 28 Nov 2017 21:54:15 +0800 Subject: [PATCH] feat(compiler): Add test for get raw binding attr --- test/unit/modules/compiler/compiler-options.spec.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/unit/modules/compiler/compiler-options.spec.js b/test/unit/modules/compiler/compiler-options.spec.js index 3abe11175fc..dc923b1faa3 100644 --- a/test/unit/modules/compiler/compiler-options.spec.js +++ b/test/unit/modules/compiler/compiler-options.spec.js @@ -131,7 +131,6 @@ describe('compile options', () => { expect(compiled.errors.length).toBe(1) expect(compiled.errors[0].start).toBe(0) expect(compiled.errors[0].end).toBeUndefined() - expect(compiled.errors[0].msg).toContain('root element') compiled = compile('
{{ b++++ }}
', { outputSourceRange: true }) expect(compiled.errors.length).toBe(2) @@ -140,4 +139,11 @@ describe('compile options', () => { expect(compiled.errors[1].start).toBe(18) expect(compiled.errors[1].end).toBe(29) }) + + it('should collect source range for binding keys', () => { + const compiled = compile('
', { outputSourceRange: true }) + expect(compiled.errors.length).toBe(1) + expect(compiled.errors[0].start).toBe(11) + expect(compiled.errors[0].end).toBe(27) + }) })