Skip to content

Commit

Permalink
add regression test für vuejs#1491
Browse files Browse the repository at this point in the history
"Multiple root nodes throwing RangeError instead of Component template
should contain exactly one root element"
  • Loading branch information
Flyingmana committed Mar 10, 2019
1 parent a51b2b5 commit 1f70282
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/fixtures/multiple-roots-template.vue
@@ -0,0 +1,4 @@
<template>
<div></div>
<div></div>
</template>
10 changes: 10 additions & 0 deletions test/template.spec.js
Expand Up @@ -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',
Expand Down

0 comments on commit 1f70282

Please sign in to comment.