From 1f70282ec6b084091f61ba4acc92c5f4a002b7f6 Mon Sep 17 00:00:00 2001 From: Flyingmana Date: Sun, 10 Mar 2019 16:29:32 +0100 Subject: [PATCH] =?UTF-8?q?add=20regression=20test=20f=C3=BCr=20#1491?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "Multiple root nodes throwing RangeError instead of Component template should contain exactly one root element" --- test/fixtures/multiple-roots-template.vue | 4 ++++ test/template.spec.js | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100644 test/fixtures/multiple-roots-template.vue diff --git a/test/fixtures/multiple-roots-template.vue b/test/fixtures/multiple-roots-template.vue new file mode 100644 index 000000000..24ab87be4 --- /dev/null +++ b/test/fixtures/multiple-roots-template.vue @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/test/template.spec.js b/test/template.spec.js index e4e936c13..1fee594ac 100644 --- a/test/template.spec.js +++ b/test/template.spec.js @@ -253,6 +253,16 @@ test('custom compiler directives', done => { }) }) +test('multiple roots in template', done => { + mockBundleAndRun({ + entry: 'multiple-roots-template.vue' + }, ({ bundleStats }) => { + expect(bundleStats.compilation.errors).toHaveLength(1) + expect(bundleStats.compilation.errors[0].message).toMatch('should contain exactly one root element') + done() + }, true) +}) + test('separate loader configuration for template lang and js imports', done => { mockBundleAndRun({ entry: './test/fixtures/template-pre.js',