@@ -8,12 +8,21 @@ const ruleTester = new RuleTester({
88ruleTester . run ( 'template-no-forbidden-elements' , rule , {
99 valid : [
1010 { code : '<template><div></div></template>' , options : [ [ 'script' ] ] } ,
11+ // Object config form
12+ { code : '<template><div></div></template>' , options : [ { forbidden : [ 'script' ] } ] } ,
13+ { code : '<template><script></script></template>' , options : [ { forbidden : [ 'html' ] } ] } ,
1114 '<template><header></header></template>' ,
1215 '<template><footer></footer></template>' ,
1316 '<template><p></p></template>' ,
1417 '<template><head><meta charset="utf-8"></head></template>' ,
1518 ] ,
1619 invalid : [
20+ {
21+ code : '<template><script></script></template>' ,
22+ output : null ,
23+ options : [ { forbidden : [ 'script' ] } ] ,
24+ errors : [ { messageId : 'forbidden' } ] ,
25+ } ,
1726 {
1827 code : '<template><script></script></template>' ,
1928 output : null ,
@@ -70,6 +79,11 @@ hbsRuleTester.run('template-no-forbidden-elements', rule, {
7079 code : '<script></script>' ,
7180 options : [ [ 'html' , 'meta' , 'style' ] ] ,
7281 } ,
82+ // Object config form.
83+ {
84+ code : '<script></script>' ,
85+ options : [ { forbidden : [ 'html' , 'meta' , 'style' ] } ] ,
86+ } ,
7387 ] ,
7488 invalid : [
7589 // Default config.
0 commit comments