Skip to content

Commit fa13aef

Browse files
committed
add tests.
1 parent 6cca458 commit fa13aef

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,17 @@ 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>'
3131
},
32+
{
33+
code: '<template v-for="i in 5"><comp v-for="j in 10">{{i}}{{j}}</comp></template>'
34+
},
35+
{
36+
code: '<template><ol v-for="i in data"><li v-for="f in i">{{ f.bar.baz }}</li></ol></template>'
37+
},
3238
{
3339
code: '<template scope="props">{{props}}</template>'
3440
},
@@ -44,6 +50,14 @@ tester.run('no-unused-vars', rule, {
4450
{
4551
code: '<template scope="props"></template>',
4652
errors: ['\'props\' is defined but never used.']
53+
},
54+
{
55+
code: '<template v-for="i in 5"><comp v-for="j in 10">{{i}}{{i}}</comp></template>',
56+
errors: ['\'j\' is defined but never used.']
57+
},
58+
{
59+
code: '<template><ol v-for="i in data"><li v-for="f in i"></li></ol></template>',
60+
errors: ['\'f\' is defined but never used.']
4761
}
4862
]
4963
})

0 commit comments

Comments
 (0)