Skip to content

Commit 40bcb3d

Browse files
Flyingmanayyx990803
authored andcommitted
test: add regression test for #1491 (#1510)
1 parent a51b2b5 commit 40bcb3d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<template>
2+
<div></div>
3+
<div></div>
4+
</template>

test/template.spec.js

+10
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,16 @@ test('custom compiler directives', done => {
253253
})
254254
})
255255

256+
test('multiple roots in template', done => {
257+
mockBundleAndRun({
258+
entry: 'multiple-roots-template.vue'
259+
}, ({ bundleStats }) => {
260+
expect(bundleStats.compilation.errors).toHaveLength(1)
261+
expect(bundleStats.compilation.errors[0].message).toMatch('should contain exactly one root element')
262+
done()
263+
}, true)
264+
})
265+
256266
test('separate loader configuration for template lang and js imports', done => {
257267
mockBundleAndRun({
258268
entry: './test/fixtures/template-pre.js',

0 commit comments

Comments
 (0)