Skip to content

Commit 3eb9f78

Browse files
committed
add tests.
1 parent 6cca458 commit 3eb9f78

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/lib/rules/no-unused-vars.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const tester = new RuleTester({
2424
tester.run('no-unused-vars', rule, {
2525
valid: [
2626
{
27-
code: '<template><ol v-for="i in 5"><li>{{i}}</li></ol></template>'
27+
code: '<template><ol v-for="i in 5"><li><span>{{i}}</span></li></ol></template>'
2828
},
2929
{
3030
code: '<template><ol v-for="i in 5"><li :prop="i"></li></ol></template>'
@@ -34,6 +34,9 @@ tester.run('no-unused-vars', rule, {
3434
},
3535
{
3636
code: '<template scope="props"><span v-if="props"></span></template>'
37+
},
38+
{
39+
code: '<template v-for="i in 5"><comp v-for="j in 10">{{i}}{{j}}</comp></template>'
3740
}
3841
],
3942
invalid: [
@@ -44,6 +47,10 @@ tester.run('no-unused-vars', rule, {
4447
{
4548
code: '<template scope="props"></template>',
4649
errors: ['\'props\' is defined but never used.']
50+
},
51+
{
52+
code: '<template v-for="i in 5"><comp v-for="j in 10">{{i}}{{i}}</comp></template>',
53+
errors: ['\'j\' is defined but never used.']
4754
}
4855
]
4956
})

0 commit comments

Comments
 (0)