@@ -22,11 +22,17 @@ tester.run('no-empty-component-block', rule, {
22
22
`<template src="./template.html" /><script src="./script.js" />` ,
23
23
`<template src="./template.html"></template><script src="./script.js"></script><style src="./style.css"></style>` ,
24
24
`<template src="./template.html" /><script src="./script.js" /><style src="./style.css" />` ,
25
- `var a = 1`
25
+ `var a = 1` ,
26
+ // options
27
+ {
28
+ code : '<template><p>foo</p></template>' ,
29
+ options : [ { autofix : true } ]
30
+ }
26
31
] ,
27
32
invalid : [
28
33
{
29
34
code : `<template></template>` ,
35
+ output : null ,
30
36
errors : [
31
37
{
32
38
message : '`<template>` is empty. Empty block is not allowed.'
@@ -35,6 +41,7 @@ tester.run('no-empty-component-block', rule, {
35
41
} ,
36
42
{
37
43
code : `<template> </template>` ,
44
+ output : null ,
38
45
errors : [
39
46
{
40
47
message : '`<template>` is empty. Empty block is not allowed.'
@@ -44,6 +51,7 @@ tester.run('no-empty-component-block', rule, {
44
51
{
45
52
code : `<template>
46
53
</template>` ,
54
+ output : null ,
47
55
errors : [
48
56
{
49
57
message : '`<template>` is empty. Empty block is not allowed.'
@@ -52,6 +60,7 @@ tester.run('no-empty-component-block', rule, {
52
60
} ,
53
61
{
54
62
code : '<template />' ,
63
+ output : null ,
55
64
errors : [
56
65
{
57
66
message : '`<template>` is empty. Empty block is not allowed.'
@@ -60,6 +69,7 @@ tester.run('no-empty-component-block', rule, {
60
69
} ,
61
70
{
62
71
code : '<template src="" />' ,
72
+ output : null ,
63
73
errors : [
64
74
{
65
75
message : '`<template>` is empty. Empty block is not allowed.'
@@ -68,6 +78,7 @@ tester.run('no-empty-component-block', rule, {
68
78
} ,
69
79
{
70
80
code : '<template></template><script></script>' ,
81
+ output : null ,
71
82
errors : [
72
83
{
73
84
message : '`<template>` is empty. Empty block is not allowed.'
@@ -79,6 +90,7 @@ tester.run('no-empty-component-block', rule, {
79
90
} ,
80
91
{
81
92
code : '<template /><script />' ,
93
+ output : null ,
82
94
errors : [
83
95
{
84
96
message : '`<template>` is empty. Empty block is not allowed.'
@@ -90,6 +102,7 @@ tester.run('no-empty-component-block', rule, {
90
102
} ,
91
103
{
92
104
code : '<template src="" /><script src="" />' ,
105
+ output : null ,
93
106
errors : [
94
107
{
95
108
message : '`<template>` is empty. Empty block is not allowed.'
@@ -101,6 +114,7 @@ tester.run('no-empty-component-block', rule, {
101
114
} ,
102
115
{
103
116
code : '<template></template><script></script><style></style>' ,
117
+ output : null ,
104
118
errors : [
105
119
{
106
120
message : '`<template>` is empty. Empty block is not allowed.'
@@ -115,6 +129,7 @@ tester.run('no-empty-component-block', rule, {
115
129
} ,
116
130
{
117
131
code : '<template /><script /><style />' ,
132
+ output : null ,
118
133
errors : [
119
134
{
120
135
message : '`<template>` is empty. Empty block is not allowed.'
@@ -129,6 +144,7 @@ tester.run('no-empty-component-block', rule, {
129
144
} ,
130
145
{
131
146
code : '<template src="" /><script src="" /><style src="" />' ,
147
+ output : null ,
132
148
errors : [
133
149
{
134
150
message : '`<template>` is empty. Empty block is not allowed.'
@@ -140,6 +156,47 @@ tester.run('no-empty-component-block', rule, {
140
156
message : '`<style>` is empty. Empty block is not allowed.'
141
157
}
142
158
]
159
+ } ,
160
+ // autofix
161
+ {
162
+ code : `<template></template>` ,
163
+ output : '' ,
164
+ options : [ { autofix : true } ] ,
165
+ errors : [
166
+ {
167
+ message : '`<template>` is empty. Empty block is not allowed.'
168
+ }
169
+ ]
170
+ } ,
171
+ {
172
+ code : '<template></template><script></script><style></style>' ,
173
+ output : '' ,
174
+ options : [ { autofix : true } ] ,
175
+ errors : [
176
+ {
177
+ message : '`<template>` is empty. Empty block is not allowed.'
178
+ }
179
+ ]
180
+ } ,
181
+ {
182
+ code : '<template /><script /><style />' ,
183
+ output : '' ,
184
+ options : [ { autofix : true } ] ,
185
+ errors : [
186
+ {
187
+ message : '`<template>` is empty. Empty block is not allowed.'
188
+ }
189
+ ]
190
+ } ,
191
+ {
192
+ code : '<template src="" /><script src="" /><style src="" />' ,
193
+ output : '' ,
194
+ options : [ { autofix : true } ] ,
195
+ errors : [
196
+ {
197
+ message : '`<template>` is empty. Empty block is not allowed.'
198
+ }
199
+ ]
143
200
}
144
201
]
145
202
} )
0 commit comments