@@ -14,21 +14,36 @@ const tester = new RuleTester({
14
14
tester . run ( 'no-empty-component-block' , rule , {
15
15
valid : [
16
16
`<template><p>foo</p></template>` ,
17
+ `<template> foobar </template>` ,
17
18
`<template><p>foo</p></template><script>console.log('foo')</script>` ,
18
19
`<template><p>foo</p></template><script>console.log('foo')</script><style>p{display: inline;}</style>` ,
19
-
20
20
`<template src="./template.html"></template>` ,
21
21
`<template src="./template.html" />` ,
22
-
23
22
`<template src="./template.html"></template><script src="./script.js"></script>` ,
24
23
`<template src="./template.html" /><script src="./script.js" />` ,
25
-
26
24
`<template src="./template.html"></template><script src="./script.js"></script><style src="./style.css"></style>` ,
27
25
`<template src="./template.html" /><script src="./script.js" /><style src="./style.css" />`
28
26
] ,
29
27
invalid : [
30
28
{
31
- code : '<template></template>' ,
29
+ code : `<template></template>` ,
30
+ errors : [
31
+ {
32
+ message : '`<template>` is empty. Empty block is not allowed.'
33
+ }
34
+ ]
35
+ } ,
36
+ {
37
+ code : `<template> </template>` ,
38
+ errors : [
39
+ {
40
+ message : '`<template>` is empty. Empty block is not allowed.'
41
+ }
42
+ ]
43
+ } ,
44
+ {
45
+ code : `<template>
46
+ </template>` ,
32
47
errors : [
33
48
{
34
49
message : '`<template>` is empty. Empty block is not allowed.'
0 commit comments